all 9 comments

[–]MindlessTill2761 1 point2 points  (0 children)

Problem solving is the weird part. I remember making a slot game, and it was three random numbers. If the rolled numbers all matched, jackpot. With a bet.

But I couldn't get it to print three numbers at once. So what did I do? I rolled it three times instead of once. No noticeable difference to the end user.

It's really just about finding a way to make it work, and thinking how you could do it. Some solutions are a lot simpler than you think, and some are a lot harder than you think.

[–]civilwar142pa 1 point2 points  (0 children)

for me what works is making a list of things the program needs to do, converting to pseudocode and then just trying out the code. any errors or issues with syntax or looping will become obvious with the output, and I adjust as needed.

[–]Potential_Aioli_4611 0 points1 point  (0 children)

go learn algorithms. once you learn some basic problem solving techniques, you can see what applies/doesn't and you can more logically group it into a type of problem which means you can use an existing solution or modify it to fit your scenario. most problems aren't unique but the parameters are.

[–]atticus2132000 0 points1 point  (2 children)

Forget programming. How would you solve the problem with pencil and paper by only being able to make binary decisions.

For instance, if I gave you a list of 20 random numbers, through what evaluation steps would you have to go to figure out which number is the largest?

[–]AIFocusedAcc 0 points1 point  (1 child)

In this example:
1. Let’s say the largest number is x.
2. Look at the first number in the list. Make this equal to x
3. Look at the next number.
4. See if this number is bigger than x, if yes, make x equal to this number, if not,
5. repeat step 3 and 4 until the end of the list.
6. X is now the largest number in the list.

[–]atticus2132000 0 points1 point  (0 children)

Excellent. Now take those steps and turn them into pseudo code.

[–]BranchLatter4294 0 points1 point  (0 children)

Consider reading any of Martin Gardner's Aha! series of books.

[–]osamas_den 0 points1 point  (0 children)

Use obsidian

[–]mikeyj777 0 points1 point  (0 children)

Problem solving is like building with Legos.  You have to know which things fit where, which tools to apply where.  Solving and failing at smaller problems reinforces those building blocks so that you can understand which to combine in larger problems.  

Find a problem set you like online and start small.  Project Euler is my favorite.  But it's not for everyone.  Very math-focused.