social.solarpunk.au

social.solarpunk.au

messing around a bit with BASIC this evening. working on the space flight simulator thingo.

there won't be any graphics, so don't get too excited xD

i'm thinking of doing a kind of 'menu' interface that lists all the star systems and then their planets, and boy will you have to wait while traveling between systems!!

REM General idea -- We have a 2D grid of coords, (X,Y).
REM 
REM If a hashed value of (X,Y) is below some threshold, then a star
REM exists. If not, then empty space.

10 REM *** PROCEDURAL STAR LOCATIONS - LARGE GALAXY ***
20 PRINT "GALAXY SCAN: STAR LOCATIONS"
30 PRINT
40 FOR X = 0 TO 255
50   FOR Y = 0 TO 255
60     S = (X*37 + Y*91) AND 32767
70    R = S - INT(S/200)*200  :REM MOD 200 FOR DENSITY (~0.5% FILLED)
80    IF R = 0 THEN PRINT "STAR AT X=";X;" Y=";Y
90   NEXT Y
100 NEXT X
110 PRINT:PRINT "--- SCAN COMPLETE ---"
120 END
replies
0
announces
1
likes
1