Please help me with this problem

Computer builds, hardware and software discussion or troubleshooting, including peripherals. Essentially a general place to talk about desktop computers.
Locked
Anonymous

Please help me with this problem

Post by Anonymous »

please help me to make a turing program for my school project that outputs a 3-by-3 array of random integers between 1 and 30, then output it a second time rateated 90 degrees, as in the illustratrions below:

original two-dimensional array:

12 18 30
5 24 18
22 23 11

rotated 90 degrees to form:

22 5 12
23 24 18
11 19 30

thanks a lot

Archived topic from Iceteks, old topic ID:4363, old post ID:35112
Anonymous

Please help me with this problem

Post by Anonymous »

Assign them variables then use locate (x, y) to put that variable at that location. No array junk at all.

edit: var v1, v2, v3, v4, v5, v6, v7, v8, v9 : int
randint (v1) %i forget how that even works
randint (v2)

ETC.


locate (1,1)
put v1

ETC.

AFTER ROTATION


locate (1,7)
put v1

ETC.

Archived topic from Iceteks, old topic ID:4363, old post ID:35124
Locked