init repo
This commit is contained in:
commit
90e6151613
3260 files changed
+3745062
No files matched your search
@@ -0,0 +1,121 @@
|
||||
|
||||
gcl0x
|
||||
|
||||
{ Queens(N) for N=1-10: 51.385 seconds }
|
||||
|
||||
$ffff FFFF=
|
||||
|
||||
\SYS_LSRW1_48 \sysFn:
|
||||
|
||||
[def {Search}
|
||||
push
|
||||
10-- cols 0%= diagL 2%= diagR 4%= next 6%= avail 8%=
|
||||
|
||||
diagL diagR| FFFF^ cols& avail=
|
||||
|
||||
[do
|
||||
0 avail- avail& next=
|
||||
|
||||
if<>0
|
||||
|
||||
0% {cols} next^ [if<>0
|
||||
cols=
|
||||
2% {diagL} next^ 1<< {LSLW} diagL=
|
||||
4% {diagR} next^ 48!! {LSRW} diagR=
|
||||
Search!
|
||||
|
||||
avail next^ avail=
|
||||
loop]
|
||||
Count 1+ Count=
|
||||
{Break}
|
||||
]
|
||||
|
||||
0% cols= 2% diagL= 4% diagR= 6% next= 8% avail= 10++
|
||||
pop ret
|
||||
] Search=
|
||||
|
||||
[def {DrawChar}
|
||||
{Map ASCII code to offset in font table}
|
||||
Char 82- [if<0 50+ i= \font32up
|
||||
else i= \font82up] fontData= {Select low or high page}
|
||||
i i+ tmp= tmp+ i+ {Multiply by 5}
|
||||
fontData+ fontData= {Add to page address to reach bitmap data for Char}
|
||||
$800 Pos+ q= {Where to stop the inner drawing loop}
|
||||
|
||||
{Draw 6 vertical slices: 5 using font data, the last with all-zeros}
|
||||
5 i= [do
|
||||
[if<>0 fontData 0? fontData<++ else 0] bits=
|
||||
Pos p=
|
||||
{Draw vertical slice}
|
||||
[do
|
||||
bits 128& [if=0 32 {Blue} else Color] p.
|
||||
bits bits+ bits=
|
||||
p>++
|
||||
p q- if<0loop]
|
||||
Pos<++
|
||||
i 1- i= if>=0loop]
|
||||
ret
|
||||
] DrawChar=
|
||||
|
||||
{-----------------------------------------------------------------------+
|
||||
|}\vLR>++ ret{ RAM page 4 |
|
||||
+-----------------------------------------------------------------------}
|
||||
$0400:
|
||||
|
||||
[def {DrawNextDigit}
|
||||
push
|
||||
Radix=
|
||||
Value Radix- [if>=0
|
||||
Value=
|
||||
$31 Char=
|
||||
Value [do
|
||||
Radix-
|
||||
if>=0
|
||||
Value=
|
||||
Char<++
|
||||
loop
|
||||
]
|
||||
DrawChar!
|
||||
$30 Char=
|
||||
else
|
||||
DrawChar!
|
||||
]
|
||||
pop ret
|
||||
] DrawNextDigit=
|
||||
|
||||
[def {DrawNumber}
|
||||
push
|
||||
Value=
|
||||
$20 Char=
|
||||
10000 DrawNextDigit!
|
||||
1000 DrawNextDigit!
|
||||
100 DrawNextDigit!
|
||||
10 DrawNextDigit! $30 Char=
|
||||
1 DrawNextDigit!
|
||||
pop ret
|
||||
] DrawNumber=
|
||||
|
||||
[def {NewLine}
|
||||
$800 Pos+ 255| 255^ Pos=
|
||||
ret
|
||||
] NewLine=
|
||||
|
||||
{ Main }
|
||||
|
||||
63 Color=
|
||||
[do
|
||||
1 Q= A= $2000 Pos=
|
||||
[do
|
||||
Q DrawNumber!
|
||||
0 Count=
|
||||
A cols= 0 diagL= diagR= Search!
|
||||
Count DrawNumber! NewLine!
|
||||
|
||||
A 1<< 1+ A=
|
||||
Q 1+ Q=
|
||||
10- if<=0loop]
|
||||
|
||||
120 \soundTimer.
|
||||
Color 9- Color=
|
||||
loop]
|
||||
|
||||
Binary file not shown.
Reference in new issue
Block a user