|
|
| Title: oNE GAME FOR 200LX |
| Posted By: ZoranV (Registered) |
| E-mail: See Profile |
| Date: 03/24/2002 at 14:22:30 |
Message:Hi, I am the new owner of 200lx and last 30 years I am in IT... I've found one of my old old games: for given 5 (possible more) numbers, max 255 (posible more) players can substract any number from just one given number of 5... Winer is first one who get all (5) zero's... I put gwbasic onto 200lx and tiped basic program to show algorithm... With your 200lx you can play simultaniously with lot of players... Because comp gives stable state and the other player only make it unstable. If the first player give you the stable state 5 nubmers stay the same and you can substract just one from bigest number and wait the other player to make mistake... Trivial stable state is x,x,0,0,0 because if the other player makes it x-n,x,0,0,0 you make x-n,x-n,0,0,0 The other trivial stable state is x,y,x,y,0... If you want to play just rem all prints except 60,450 and 490 (there are few remed prints from debugging also...) As you will see stable state is when all columns of binary presentations of the 5 numbers has even numbers of 1's (test line shows it). There is no the end of program, just CtrlC... If you don't know it and like it make it finished :) 10 CLEAR 20 DEFINT A-Z 30 OPTION BASE 1 40 DIM D(5),B(40),T(8) 50 INPUT D(1),D(2),D(3),D(4),D(5) 60 PRINT D(1);D(2);D(3);D(4);D(5) 70 GOSUB 90 80 GOTO 290 90 REM 100 FOR I=1 TO 5 110 FOR J=1 TO 8 120 B((I-1)*8+J)=(D(I) AND 2^(8-J))/2^(8-J) 130 PRINT B((I-1)*8+J); 140 NEXT J 150 PRINT D(I) 160 NEXT I 170 PRINT 180 FOR J=1 TO 8 190 T(J)=0 200 FOR I=1 TO 5 210 T(J)=T(J) + B((I-1)*8+J) 220 NEXT I 230 TT=T(J)/2 240 T(J)=ABS(T(J)-TT*2) 250 PRINT T(J); 260 NEXT J 270 PRINT "test" 280 RETURN 290 FOR J=1 TO 8 300 PRINT 310 IF T(J)=0 THEN 480 320 REM PRINT J 330 FOR I=1 TO 5 340 IF B((I-1)*8+J)=0 THEN 470 350 REM PRINT I 360 FOR K=J TO 8 370 IF T(K) = 1 THEN B((I-1)*8+K)=1-B((I-1)*8+K) 380 REM PRINT ((I-1)*8+K); B((I-1)*8+K) 390 NEXT K 400 D(I)=0 410 FOR K=1 TO 8 420 D(I)=D(I)+B((I-1)*8+K)*2^(8-K) 430 NEXT K 440 GOSUB 90 450 PRINT D(1);D(2);D(3);D(4);D(5) 460 GOTO 10 470 NEXT I 480 NEXT J 490 PRINT D(1);D(2);D(3);D(4);D(5) 500 GOTO 10
Is this message offensive or in violation of this board's policies?
If so report it by clicking here.
|