Python Forum

Full Version: Help with a Matrix nxn with black and white input
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi
I need to create an array nxn whose entries are black if they are 1 or white if they are 0

then if we choose a random point, move to the left if the square is black or to the left if it is white, then change the square color and repeat until you return to the initial frame.
You need clarity in your mind. Please think about your problem, decompose it into smaller problems and solve them one at the time. If problem encountered provide code and ask for help.

Do your really want always move to the left: 'move to the left if the square is black or to the left if it is white'
(Nov-24-2019, 07:02 AM)perfringo Wrote: [ -> ]You need clarity in your mind. Please think about your problem, decompose it into smaller problems and solve them one at the time. If problem encountered provide code and ask for help.

Do your really want always move to the left: 'move to the left if the square is black or to the left if it is white'
I'm sorry I don't speak English very well so when I translated it I didn't realize the error, It should say left if it's black and right if it's white.
Hello,
and welcome to the forum. What have you tried? We are glad to help, but we are not here to do your homework for you.
Please, post your code (in code tags) and ask specific questions. Don't forget to include the full traceback (in error tags) if you get one.