+ 14
[ASSIGNMENT] Magnetic Numbers
Hey, lets pretend that numbers are the poles of a magnet. if the number is even its a positive pole(+) if the is number is odd is a negitive pole(-) Using our random number (0-9) side by side,above and below we decide if the numbers repel or attract eachother. Like poles repel <> Unlike poles attract >< Example input 3 x 2: 6<>2 ^ v v ^ 2><3 ^ ^ v v 2><1 Thanks đđ
5 Answers
+ 11
My code. rows columns on input line
https://code.sololearn.com/c9qch5Gaa08j
+ 3
Well, here is my solution: https://code.sololearn.com/cFBO85D5OT4R/?ref=app
It requires two numbers as an input: number of rows and columns in the output matrix.
Have fun playing around!
- 3
Shouldn't every digit be a pole?
5544 is net 0, so maybe everything attracts to it? Similar to magnetic metals that are not magnets.
334 is 2 neg, 1 pos, net of -1. Interesting....