Page 1 of 1

Please help me with this problem

Posted: Sat May 27, 2006 1:48 pm
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

Please help me with this problem

Posted: Mon May 29, 2006 6:21 pm
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