tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
|
|
@ -0,0 +1,31 @@
|
|||
EnableExplicit
|
||||
Dim cG.i(21)
|
||||
Dim nG.i(21)
|
||||
Define.i n, Gen
|
||||
|
||||
DataSection
|
||||
Data.i 0,1,1,1,0,1,1,0,1,0,1,0,1,0,1,0,0,1,0,0
|
||||
EndDataSection
|
||||
For n=1 To 20
|
||||
Read.i cG(n)
|
||||
Next
|
||||
|
||||
OpenConsole()
|
||||
Repeat
|
||||
Print("Generation "+Str(Gen)+": ")
|
||||
For n=1 To 20
|
||||
Print(Chr(95-cG(n)*60))
|
||||
Next
|
||||
Gen +1
|
||||
PrintN("")
|
||||
For n=1 To 20
|
||||
If (cG(n) And (cG(n-1) XOr cg(n+1))) Or (Not cG(n) And (cG(n-1) And cg(n+1)))
|
||||
nG(n)=1
|
||||
Else
|
||||
nG(n)=0
|
||||
EndIf
|
||||
Next
|
||||
Swap cG() , nG()
|
||||
Until Gen > 9
|
||||
|
||||
PrintN("Press any key to exit"): Repeat: Until Inkey() <> ""
|
||||
Loading…
Add table
Add a link
Reference in a new issue