![]() |
|
Hypnotist[QBasic] - Printable Version +- Sinisterly (https://sinister.li) +-- Forum: Coding (https://sinister.li/Forum-Coding) +--- Forum: Coding (https://sinister.li/Forum-Coding--71) +--- Thread: Hypnotist[QBasic] (/Thread-Hypnotist-QBasic) |
Hypnotist[QBasic] - Slarek - 09-27-2013 Little script which makes you feel dizzy...... Code: SCREEN 13
sizex% = 320
sizey% = 200
FOR i% = 0 TO 63
OUT 968, i%
OUT 969, i%
OUT 969, 0
OUT 969, 63 - i%
OUT 968, i% + 64
OUT 969, 63 - i%
OUT 969, i%
OUT 969, 0
OUT 968, i% + 128
OUT 969, 0
OUT 969, 63 - i%
OUT 969, i%
NEXT i%
FOR x% = 0 TO sizex% - 1
FOR y% = 0 TO sizey% - 1
xx% = x% - sizex% / 2
yy% = y% - sizey% / 2
IF xx% = 0 THEN
IF yy% < 0 THEN angle = 270 ELSE angle = 90
ELSE
angle = ATN(yy% / xx%) / (3.1415 / 180)
IF xx% <= 0 THEN angle = angle + 180
IF angle < 0 THEN angle = 360 + angle
END IF
distance% = SQR(xx% ^ 2 + yy% ^ 2)
flush% = INT((angle / 360 * 192 * 2 + distance%) MOD 192)
PSET (x%, y%), flush%
NEXT y%
IF INKEY$ = CHR$(27) THEN EXIT FOR
NEXT x%
i% = 0
DO
i% = i% + 1
IF i% = 192 THEN i% = 0
FOR a% = 0 TO 63
OUT 968, (a% + i%) MOD 192
OUT 969, a%
OUT 969, 0
OUT 969, 63 - a%
OUT 968, (a% + 64 + i%) MOD 192
OUT 969, 63 - a%
OUT 969, a%
OUT 969, 0
OUT 968, (a% + 128 + i%) MOD 192
OUT 969, 0
OUT 969, 63 - a%
OUT 969, a%
NEXT a%
SOUND 0, .1
LOOP UNTIL INKEY$ = CHR$(27)RE: Hypnotist[QBasic] - Ligeti - 02-14-2014 This is really cool (took forever to start though lol), I wish I could upload a screen shot! Thanks for sharing, was really fun! RE: Hypnotist[QBasic] - Ligeti - 02-14-2014 This is really cool (took forever to start though lol), I wish I could upload a screen shot! Thanks for sharing, was really fun! RE: Hypnotist[QBasic] - Slarek - 02-14-2014 (02-14-2014, 03:56 AM)Ligeti Wrote: This is really cool (took forever to start though lol), I wish I could upload a screen shot! Thanks for reply. This is rather simple, it was good practice though. RE: Hypnotist[QBasic] - Ligeti - 02-14-2014 Yes, I had to install dosbox and download olddos on linux to test it... But the real reason why I tried your code is that I actually started learning programming using QBasic and SuperBasic... those days were fun. Thanks sharing Happy Coding RE: Hypnotist[QBasic] - Ligeti - 02-14-2014 Yes, I had to install dosbox and download olddos on linux to test it... But the real reason why I tried your code is that I actually started learning programming using QBasic and SuperBasic... those days were fun. Thanks sharing Happy Coding |