Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
34
Task/Box-the-compass/QBasic/box-the-compass.basic
Normal file
34
Task/Box-the-compass/QBasic/box-the-compass.basic
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
DECLARE FUNCTION compasspoint$ (h!)
|
||||
|
||||
DIM SHARED point$(32)
|
||||
|
||||
FOR i = 1 TO 32
|
||||
READ d$: point$(i) = d$
|
||||
NEXT i
|
||||
|
||||
FOR i = 0 TO 32
|
||||
heading = i * 11.25
|
||||
IF (i MOD 3) = 1 THEN
|
||||
heading = heading + 5.62
|
||||
ELSE
|
||||
IF (i MOD 3) = 2 THEN heading = heading - 5.62
|
||||
END IF
|
||||
ind = i MOD 32 + 1
|
||||
PRINT ind, compasspoint$(heading), heading
|
||||
NEXT i
|
||||
END
|
||||
|
||||
DATA "North ", "North by east ", "North-northeast ", "Northeast by north"
|
||||
DATA "Northeast ", "Northeast by east ", "East-northeast ", "East by north "
|
||||
DATA "East ", "East by south ", "East-southeast ", "Southeast by east "
|
||||
DATA "Southeast ", "Southeast by south", "South-southeast ", "South by east "
|
||||
DATA "South ", "South by west ", "South-southwest ", "Southwest by south"
|
||||
DATA "Southwest ", "Southwest by west ", "West-southwest ", "West by south "
|
||||
DATA "West ", "West by north ", "West-northwest ", "Northwest by west "
|
||||
DATA "Northwest ", "Northwest by north", "North-northwest ", "North by west "
|
||||
|
||||
FUNCTION compasspoint$ (h)
|
||||
x = h / 11.25 + 1.5
|
||||
IF (x >= 33!) THEN x = x - 32!
|
||||
compasspoint$ = point$(INT(x))
|
||||
END FUNCTION
|
||||
Loading…
Add table
Add a link
Reference in a new issue