Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 10 RANDOMIZE
- 20 DIM DNA[2000]
- 30 LENGTH=10
- 40 POSITION=1
- 50 M=RND
- 60 IF M<.5 THEN M=0 ELSE M=1
- 70 DNA[POSITION]=M
- 80 RESULT=0
- 90 FOR I=1 TO POSITION
- 100 IF DNA=0 THEN RESULT=RESULT-1 ELSE RESULT=RESULT+1
- 110 NEXT I
- 120 IF RESULT<0 OR RESULT>10 THEN GOTO 50
- 130 POSITION=POSITION+1
- 140 IF POSITION<LENGTH THEN GOTO 50
- 150 PRINT "CODE:"
- 160 FOR I=1 TO LENGTH
- 170 PRINT DNA" ";
- 180 NEXT I
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement