+ 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 😉👍

10th Apr 2018, 9:41 PM
D_Stark
D_Stark - avatar
5 Answers
12th Apr 2018, 5:47 AM
LukArToDo
LukArToDo - avatar
+ 11
My code. rows columns on input line https://code.sololearn.com/c9qch5Gaa08j
11th Apr 2018, 12:26 AM
John Wells
John Wells - avatar
+ 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!
11th Apr 2018, 12:07 AM
Nevfy
- 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....
11th Apr 2018, 2:24 PM
What was my name again?
What was my name again? - avatar