pouët.net

The random BASIC program thread

category: general [glöplog]
 
Every post adds another line to the program...

10 PRINT "WELCOME TO THE POUET RANDOM PROGRAM! WHAT IS YOUR NAME?":INPUT NAME$
added on the 2006-09-22 00:51:23 by xeron xeron
20 GOTO 10
added on the 2006-09-22 00:57:47 by britelite britelite
REM This program was created by xeron and britelite. Thank you, ATH500, for your comment.
added on the 2006-09-22 01:22:45 by ATH500 ATH500
15 ?"dream of structured programming. A world without goto"
added on the 2006-09-22 01:41:41 by GbND GbND
11 for x = 0 to 10000: poke 53280,x: for bla=0 to 100: next bla: next x
added on the 2006-09-22 01:45:39 by StingRay StingRay
?ILLEGAL QUANTITY ERROR IN 11
READY.
_
added on the 2006-09-22 02:05:05 by Jailbird Jailbird
12 ? "I am amazed that line 11 somewhat works, it's been 17 years since I did some C64 basic crap (and I never was a good basic programmer anyway). 68000 asm ftw!!!one1"
added on the 2006-09-22 02:39:05 by StingRay StingRay
13 GOSUB 20
5 END
1 NEW
1 GOTO 10
16 END
20 ?"You know, it's possible to overwrite code-lines!"
21 RETURN
added on the 2006-09-22 07:04:36 by Adok Adok
Code: set ie=wscript.createobject("internetexplorer.application") ie.fullscreen=1:ie.navigate "about:blank" while ie.readystate<4:wend with ie.document with .body .onkeydown=getref("close") .onmousedown=getref("close") .style.backgroundcolor=0 .scroll="no" end with set el=.createelement("DIV") with el .innertext="BASSic" with .style .textalign="center" .color="red" .fontsize=180 .position="absolute" .width="100%" end with end with .body.appendchild(el) .parentwindow.setinterval getref("piemel"),25 end with ie.visible=1 xpiemel=0:piemeldelta=10 sub piemel el.style.top=xpiemel xpiemel=xpiemel+piemeldelta if xpiemel>ie.document.parentwindow.screen.availheight-el.clientheight or xpiemel<0 then piemeldelta=-piemeldelta el.style.filter="wave(strength=8,freq=0,lightstrength=100,phase=" & xpiemel & ")" end sub sub close:ie.quit:ie=null:end sub while isobject(ie):wscript.sleep 2000:wend

.vbs
added on the 2006-09-22 07:45:02 by Tolle Tolle
0 GOTO 100
added on the 2006-09-22 09:12:36 by xeron xeron
10 if peek(54297) = 255 then 10
20 ?"You just licked my joy port #1!!!"

p.s: you can try 54298 too, same effect.
added on the 2006-09-22 09:16:02 by Skate Skate
10 cpu = 64
20 poke 53295,0
30 if peek(53295) <> 255 then cpu = cpu * 2
40 print "this is a commodore";cpu

added on the 2006-09-22 09:23:05 by Skate Skate
10 REM SCREEN CONFIGURATION
20 POKE 53280,13
30 POKE 53281,6
40 PRINT "";
50 OPEN 15,8,15
60 REM VARIABLE DECLARATIONS
70 DIM F1%(42),F2%(42),M%(42,42)
80 DIM V%,J,I
90 REM INITIALISE SCREEN
100 PRINT "";
110 PRINT " NEURON NETWORK ASSOCIATIVE MEMORY"
120 PRINT
130 PRINT "";
140 PRINT "F1 - TEACH PATTERN ";
150 PRINT "F2 - DUMP MATRIX"
160 PRINT "F3 - RANDOMIZE PATTERN ";
170 PRINT "F4 - FORGET ALL"
180 PRINT "F5 - RECALL PATTERN ";
190 PRINT "F6 - QUIT"
200 PRINT "F7 - DISC SAVE ";
210 PRINT "F8 - DISC LOAD"
220 PRINT
230 PRINT "A-Z, 0-9: LOAD PATTERN"
240 R1 = 4 : C1 = 5 : GOSUB 600
250 R1 = 4 : C1 = 25 : GOSUB 600
260 GOSUB 750
270 GOSUB 860
280 GOSUB 970:PRINT " READY "
290 GET A$ : IF A$="" GOTO 290
300 GOSUB 970:PRINT " "
310 K=ASC(A$)
320 IFA$>="0"ANDA$<="9"THENK=K+64:GOTO340
330 IF A$ < "A" OR A$ > "Z" THEN 500
340 GOSUB 970:PRINT "FETCH ";A$
350 L%=0
360 K=(K-64)*8+53248
370 POKE56333,127:POKE 1,PEEK(1)AND251
380 FORI=0TO6:POKE49408+I,PEEK(K+I):NEXT
390 POKE 1,PEEK(1) OR 4:POKE 56333,129
400 FOR I = 0 TO 6
410 J% = PEEK(49408+I)/2
420 FOR K=1 TO 6
430 L%=L%+1
440 F1%(L%) = -1 + (2 * (J% AND 1))
450 J%=J%/2
460 NEXT K
470 NEXT I
480 GOSUB 750 : GOSUB 860 : GOTO 280
490 REM DISPATCH FUNCTION KEY COMMANDS
500 J%=ASC(A$)-132
510 IF J%=1 THEN GOSUB 1000:GOTO 280
520 IF J%=5 THEN GOSUB 1080:GOTO 90
530 IF J%=2 THEN GOSUB 1210:GOTO 280
540 IF J%=6 THEN GOSUB 1680:GOTO 280
550 IF J%=3 THEN GOSUB 1290:GOTO 280
560 IF J%=7 THEN PRINT "";:CLOSE15:END
570 IF J%=4 THEN GOSUB 1800:GOTO 90
580 IF J%=8 THEN GOSUB 1990:GOTO 90
590 GO TO 280
600 REM DRAW BORDERS FOR FIELDS
610 FOR I=0 TO 1
620 V=1024+40*(R1+(I*8))+C1
630 POKE V,112+(-3*I)
640 FOR J=1 TO 8
650 POKE V+J,67
660 NEXT J
670 POKE V+9,110+(15*I)
680 NEXT I
690 FOR I=1 TO 7
700 V=1024+40*(R1+I)+C1
710 POKE V,93
720 POKE V+9,93
730 NEXT I
740 RETURN
750 REM UPDATE FIELD F2% ON SCREEN
760 L%=0
770 FOR I=0 TO 6
780 V% = 1024+40*(I+5)+6
790 FOR J=2 TO 7
800 L%=L%+1
810 IFF1%(L%)=1THENPOKEV%+(8-J),81:GOTO830
820 POKE V%+(8-J),32
830 NEXT J
840 NEXT I
850 RETURN
860 REM UPDATE FIELD F1% ON SCREEN
870 L%=0
880 FOR I = 0 TO 6
890 V%=1024+40*(I+5)+26
900 FOR J=2 TO 7
910 L%=L%+1
920 IF F2%(L%)=1 THEN POKE V%+(8-J),81:GOTO 940
930 POKE V%+(8-J),32
940 NEXT J
950 NEXT I
960 RETURN
970 REM POSITION TO STATUS AREA
980 PRINT "";
990 RETURN
1000 REM TRAIN ON PATTERN IN F1%
1010 GOSUB 970:PRINT "TRAINING"
1020 FOR I = 1 TO 42
1030 FOR J = 1 TO 42
1040 M%(I,J)=M%(I,J)+F1%(I)*F1%(J)
1050 NEXT J
1060 NEXT I
1070 RETURN
1080 REM PRINT PART OF MATRIX
1090 PRINT "";
1100 FOR I=1 TO 24
1110 FOR J=1 TO 39
1120 IFM%(I,J)<0THENPRINT "";:GOTO1140
1130 PRINT "";
1140 PRINT CHR$(ASC("0")+ABS(M%(I,J)));
1150 NEXT J
1160 PRINT
1170 NEXT I
1180 PRINT "PRESS ANY KEY TO CONTINUE:";
1190 GET A$ : IF A$="" GOTO 1190
1200 RETURN
1210 REM RANDOMISE 10 PERCENT OF F1%
1220 GOSUB 970:PRINT "RANDOM"
1230 FOR I=1 TO 42
1240 IF RND(0) > 0.1 THEN 1260
1250 F1%(I)=-F1%(I)
1260 NEXT I
1270 GOSUB 750
1280 RETURN
1290 REM RECALL FROM PATTERN
1300 GOSUB 970:PRINT "RECALL"
1310 P%=1024+40*9+19
1320 REM INITIALLY COPY F1 TO F2
1330 POKE P%+1,ASC("=")
1340 FOR I=1 TO 42
1350 F2%(I)=F1%(I)
1360 NEXT I
1370 GOSUB 860
1380 REM F1 TO F2 PASS
1390 POKE P%,ASC("=")
1400 POKE P%+2,ASC(">")
1410 FOR J=1 TO 42
1420 V%=0
1430 FOR I=1 TO 42
1440 V%=V%+F1%(I)*M%(I,J)
1450 NEXT I
1460 V%=SGN(V%)
1470 IF V%<>0 THEN F2%(J)=V%
1480 NEXT J
1490 GOSUB 860
1500 REM F2 TO F1 PASS
1510 C%=0
1520 POKE P%,ASC("<")
1530 POKE P%+2,ASC("=")
1540 FOR I=1 TO 42
1550 V%=0
1560 FOR J=1 TO 42
1570 V%=V%+F2%(J)*M%(I,J)
1580 NEXT J
1590 V%=SGN(V%)
1600 IFV%<>0ANDV%<>F1%(I)THENF1%(I)=V%:C%=1
1610 NEXT I
1620 GOSUB 750
1630 IF C%<>0 GOTO 1380
1640 POKE P%,ASC(" ")
1650 POKE P%+1,ASC(" ")
1660 POKE P%+2,ASC(" ")
1670 RETURN
1680 REM FORGET ALL - CLEAR MEMORY
1690 GOSUB 970:PRINT "FORGET"
1700 FOR I=1 TO 42
1710 F1%(I)=0
1720 F2%(I)=0
1730 FOR J=1 TO 42
1740 M%(I,J)=0
1750 NEXT J
1760 NEXT I
1770 GOSUB 750
1780 GOSUB 860
1790 RETURN
1800 REM SAVE STATE TO DISC FILE
1810 GOSUB 970:PRINT "SAVE"
1820 PRINT "";
1830 INPUT "FILE NAME: ";A$
1840 A$="@0:"+A$+",S,W"
1850 OPEN 5,8,5,A$
1860 FOR I=1 TO 42:PRINT#5,F1%(I):NEXT
1870 GOSUB 2240
1880 FOR I=1 TO 42:PRINT#5,F2%(I):NEXT
1890 GOSUB 2240
1900 FOR I=1 TO 42
1910 FOR J=1 TO 42
1920 PRINT#5,M%(I,J)
1930 NEXT J
1940 GOSUB 2240
1950 NEXT I
1960 CLOSE 5
1970 PRINT "";
1980 RETURN
1990 REM RESTORE STATE FROM DISC FILE
2000 GOSUB 970:PRINT "RESTORE"
2010 PRINT "";
2020 INPUT "FILE NAME: ";A$
2030 A$="@0:"+A$+",S,R"
2040 P%=ASC("M")
2050 GOSUB 2240
2060 OPEN 5,8,5,A$
2070 FOR I=1 TO 42
2080 INPUT#5,F1%(I)
2090 NEXT I
2100 GOSUB 2240
2110 FOR I=1 TO 42
2120 INPUT#5,F2%(I)
2130 NEXT I
2140 GOSUB 2240
2150 FOR I=1 TO 42
2160 FOR J=1 TO 42
2170 INPUT#5,M%(I,J)
2180 NEXT J
2190 GOSUB 2240
2200 NEXT I
2210 CLOSE 5
2220 RETURN
2230 REM DISC ERROR CHECK
2240 INPUT#15,EN,EM$,ET,ES
2250 IF EN>0THEN PRINT EN,EM$,ET,ES:STOP
2260 RETURN
added on the 2006-09-22 09:33:54 by doomdoom doomdoom
1000000 ON BREAK GOTO 10
10 if else = then goto gosub cos a=b-c/d*e^f?g(h,i)&j%k, #lmn > opq (r+s)*t / uv$w(xy-z)
20 goto 10
added on the 2006-09-22 10:08:53 by alien^PDX alien^PDX
30 goto 20
added on the 2006-09-22 10:20:49 by iks iks
20 POKE 53280,1 : POKE 53281,2
added on the 2006-09-22 11:00:20 by jua jua
0 goto 0
added on the 2006-09-23 03:36:35 by xernobyl xernobyl
10 PRINT "HELLO"
20 GOTO 10

i learned programming from MTV, hehh :)
added on the 2006-09-23 03:57:17 by blala blala
Code:RANDOMIZE TIMER SCREEN 8 CLS WHILE INKEY$ <> CHR$(27) COLOR 2 PRINT CHR$(RND * 255); COLOR 10 PRINT CHR$(RND * 255); WEND


Q.
added on the 2006-09-23 04:49:41 by stage7 stage7

login