Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
19
Task/Best-shuffle/ZX-Spectrum-Basic/best-shuffle.basic
Normal file
19
Task/Best-shuffle/ZX-Spectrum-Basic/best-shuffle.basic
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
10 FOR n=1 TO 6
|
||||
20 READ w$
|
||||
30 GO SUB 1000
|
||||
40 LET count=0
|
||||
50 FOR i=1 TO LEN w$
|
||||
60 IF w$(i)=b$(i) THEN LET count=count+1
|
||||
70 NEXT i
|
||||
80 PRINT w$;" ";b$;" ";count
|
||||
90 NEXT n
|
||||
100 STOP
|
||||
1000 REM Best shuffle
|
||||
1010 LET b$=w$
|
||||
1020 FOR i=1 TO LEN b$
|
||||
1030 FOR j=1 TO LEN b$
|
||||
1040 IF (i<>j) AND (b$(i)<>w$(j)) AND (b$(j)<>w$(i)) THEN LET t$=b$(i): LET b$(i)=b$(j): LET b$(j)=t$
|
||||
1110 NEXT j
|
||||
1120 NEXT i
|
||||
1130 RETURN
|
||||
2000 DATA "abracadabra","seesaw","elk","grrrrrr","up","a"
|
||||
Loading…
Add table
Add a link
Reference in a new issue