Python Forum
Help with a Matrix nxn with black and white input
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with a Matrix nxn with black and white input
#1
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.
Reply
#2
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 not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Reply
#3
(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.
Reply
#4
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.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Problem with my Black Jack game... JengaBenga 2 1,244 Sep-27-2022, 01:10 PM
Last Post: JengaBenga
  Creating a circular matrix with one input omnisierra 18 5,502 Oct-02-2020, 01:51 PM
Last Post: perfringo
  Black holes Home alfredocaronia 2 1,967 Mar-28-2020, 05:52 PM
Last Post: alfredocaronia
  define a diagonal matrix from a matrix amalalaoui 1 2,321 May-15-2019, 01:12 PM
Last Post: ichabod801

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020