Last active
September 3, 2021 12:33
-
-
Save attilammagyar/4143524 to your computer and use it in GitHub Desktop.
Oldest existing source code of mine (good old C64!) :-)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 REMGOSUB2000 | |
20 V=53248:AD=8192:A1=PEEK(V+17):A2=PEEK(V+24) | |
30 POKEV+17,59:POKEV+24,24 | |
60 FORI=1024TO2023 | |
70 POKEI,16 | |
80 NEXTI | |
90 FORI=8192TO16383:POKEI,0:NEXTI | |
120 REMFORX=0TO319 | |
121 REMY=100 | |
122 REMGOSUB1000 | |
130 REMNEXTX | |
140 REMFORY=0TO199 | |
141 REMX=160 | |
142 REMGOSUB1000 | |
150 REMNEXTY | |
160 X=160:Y=100:U=1 | |
210 GETT$:IFT$=""THEN210 | |
220 IFT$="A"THEN X=X-1 | |
230 IFT$="D"THEN X=X+1 | |
240 IFT$="W"THEN Y=Y-1 | |
250 IFT$="S"THEN Y=Y+1 | |
260 IFT$="X"THEN U=U*(-1) | |
265 IFT$="Q"THEN 300 | |
270 IF U>0 THEN GOSUB1000 | |
280 GOTO210 | |
290 REMTP | |
300 POKEV+17,A1:POKEV+24,A2 | |
310 PRINT"" | |
999 END | |
1000 OY=320*INT(Y/8)+(Y AND 7) | |
1010 OX=8*INT(X/8) | |
1020 MA=2^((7-X) AND 7) | |
1030 AV=AD+OY+OX | |
1040 POKEAV,PEEK(AV)OR MA | |
1050 RETURN | |
2000 PRINT"LINEARIS FUGGVENY: F(X)=A * X + B" | |
2010 INPUT"A ERTEKE";A% | |
2020 INPUT"B ERTEKE";B% | |
2030 RETURN |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment