Page 2 of 2

Posted: Mon Dec 04, 2006 8:10 pm
by Xombie
PeterGams wrote:The second row runs into 2 digits. And won't rotate back to start.
Any ideas ?

Code: Select all

num5 = 5 : num6 = 8            ; or whatever 
initialNum6 = num6 
initialNum5 = num5
Repeat 
  Debug Str(num6) + " - " + Str(num5); + Str(initialNum)  ; Or whatever is being done with it 
  num6 + 2 : num5 + 2
  If num6 > 9 :  num6 - 10 
    If num5 > 9 :  num5 - 10

    EndIf
  EndIf 
  
Until num6 = initialNum6 : Or num5 = initialnum5
Here are two bits of code for you.

Code: Select all

a.l = 5
For i.l = 1 To 5
   a = (a + 2) % 10
   Debug a
Next i
That one should be a fairly quick way of doing it.

Code: Select all

Dim b.l(2)
b(0) = 3
b(1) = 4
b(2) = 1
For i.l = 1 To 5
   ;
   b(0) = (b(0) + 2) % 10
   b(1) = (b(1) + 2) % 10 
   b(2) = (b(2) + 2) % 10
   ;
   Debug Str(b(0))+" "+Str(b(1))+" "+Str(b(2))
   ;
Next i
To get your three columns.

Posted: Mon Dec 04, 2006 10:41 pm
by AND51
Please, watch the thread at the german forum. I postet my code there, too. My german mates have made some good improvements, you should have a look at their work!

[http://www.purebasic.fr/german/viewtopi ... ight=AND51]

Posted: Wed Dec 06, 2006 9:09 am
by PeterGams
WOW !!
You blokes really rock..
Thanks heaps for your help...