Skip to content

Commit e212107

Browse files
committed
deploy: aa58293
1 parent 967dad4 commit e212107

20 files changed

+134
-25
lines changed

examples/0index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,10 @@ cpcBasic.addIndex("./examples", {
223223
"key": "sierpin2",
224224
"title": "Sierpinski triangle (graphical)"
225225
},
226+
{
227+
"key": "snowflak",
228+
"title": "Snowflake"
229+
},
226230
{
227231
"key": "striart",
228232
"title": "String Art"

examples/snowflak.js

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
/* globals cpcBasic */
2+
3+
"use strict";
4+
5+
cpcBasic.addItem("", `
6+
REM snowflak - Snowflake
7+
REM
8+
REM see also: https://logiker.com/Vintage-Computing-Christmas-Challenge-2025
9+
REM Certainly this is not the shortest program.
10+
'
11+
ver=0
12+
CLS
13+
'
14+
DIM A$(9)
15+
A$(0)=" *"
16+
A$(1)=" * * *"
17+
A$(2)=" * * *** * *"
18+
A$(3)=" ** * **"
19+
A$(4)=" *** * * * ***"
20+
A$(5)=" * *** *"
21+
A$(6)=" * * *"
22+
A$(7)=" * * * * * * *"
23+
A$(8)=" * * *** * *"
24+
FOR I=0 TO 8:PRINT A$(I):NEXT
25+
PRINT STRING$(19,"*")
26+
FOR I=8 TO 0 STEP -1:PRINT A$(I):NEXT
27+
'
28+
GOSUB 9000
29+
CLS
30+
'
31+
' version by ?
32+
' https://youtu.be/9aazdLrXah8?si=OB5ODreNJa3aof3G&t=163
33+
' ...
34+
'
35+
' version by DrSnuggles 203 / 358 / 228 (source: 208+4 code: 233)
36+
' https://youtu.be/9aazdLrXah8?si=W3C_zIIGQGTPREe5&t=756
37+
FOR i=1 TO 19:READ a:b$=BIN$(a,9):s$="":r$="":FOR n=1 TO 9:c$=MID$(b$,n,1):IF c$="0"THEN c$=" " ELSE c$="*"
38+
s$=s$+c$:r$=c$+r$:NEXT:PRINT s$"*"r$:NEXT:DATA 0,2,81,48,114,9,4,146,73,511,73,146,4,9,114,48,81,2,0
39+
'
40+
GOSUB 9000
41+
CLS
42+
'
43+
' version by issalig, 169 / 187 / 168 (source: 170+4 code: 193) ??
44+
' https://youtu.be/9aazdLrXah8?si=cx3_SWDFDpMauKqY&t=931
45+
' Logiker's Christmas Challenge VCCC 2025 - The Presentation
46+
DIM D(9):FOR I=1TO 9:READ D(I):NEXT:DATA 73,146,4,9,114,48,81,2,0
47+
FOR Y=-9 TO 9:A=ABS(Y):FOR X=-9 TO 9:B=ABS(X):?CHR$(42+10*(((A*B=0)OR(D(A)AND 2^(B-1)))=0));:NEXT:?:NEXT
48+
'
49+
GOSUB 9000
50+
CLS
51+
'
52+
' version by issalig (modified): one line, DIM not necessary, DATA at the end, unneccessary brackets removed; read 8 bytes, D(9)=0 anyway; removed variables A,B (source: 149+2 code: 155)
53+
FOR I=1TO 8:READ D(I):NEXT:FOR Y=-9 TO 9:FOR X=-9 TO 9:?CHR$(42+10*((Y*X=0 OR D(ABS(Y))AND 2^(ABS(X)-1))=0));:NEXT:?:NEXT:DATA 73,146,4,9,114,48,81,2
54+
'
55+
GOSUB 9000
56+
CLS
57+
'
58+
' https://youtu.be/9aazdLrXah8?si=2iD00mHdxY1blBf4&t=1446
59+
' version by Arnolds of Leosoft (modified string chars +32 to use printable characters)(source: 137+2 code: 126)
60+
FOR y=-9 TO 9:FOR x=-9 TO 9:PRINT CHR$(9-33*(((ABS(x)=ABS(y))AND ABS(x)<8)OR(INSTR(" $'*0>C",CHR$(ABS(x*y)+32))>0)));:NEXT:PRINT:NEXT
61+
'
62+
GOSUB 9000
63+
CLS
64+
'
65+
' version by Arnolds of Leosoft (modified string chars +32 to use printable characters); remove unnecessary brackets (source: 130+2 code: 124)
66+
FOR y=-9 TO 9:FOR x=-9 TO 9:PRINT CHR$(9-33*(ABS(x)=ABS(y) AND ABS(x)<8 OR INSTR(" $'*0>C",CHR$(ABS(x*y)+32))>0));:NEXT:PRINT:NEXT
67+
'
68+
GOSUB 9000
69+
CLS
70+
'
71+
' BBC BASIC (70 Bytes), converted to Locomotive BASIC (source: 137+2 code: 124)
72+
' https://youtu.be/9aazdLrXah8?si=jST6PqBjt6DqooVR&t=1666
73+
FOR y=-9 TO 9:FOR x=-9 TO 9:PRINT CHR$(32 OR 10 AND INSTR(" $'*0>C",CHR$(ABS(x)*ABS(y)+32))>(ABS(x) MOD 9 MOD 8=ABS(y)));:NEXT:PRINT:NEXT
74+
'
75+
GOSUB 9000
76+
CLS
77+
'
78+
' BBC BASIC (70 Bytes), converted to Locomotive BASIC, combined ABS(x)*ABS(y) (source: 132+2 code: 120)
79+
FOR y=-9 TO 9:FOR x=-9 TO 9:PRINT CHR$(32 OR 10 AND INSTR(" $'*0>C",CHR$(ABS(x*y)+32))>(ABS(x) MOD 9 MOD 8=ABS(y)));:NEXT:PRINT:NEXT
80+
'
81+
GOSUB 9000
82+
STOP
83+
'
84+
9000 ver=ver+1
85+
?:? "Version"; ver
86+
t=TIME+300:WHILE TIME<t AND INKEY$="":WEND
87+
RETURN
88+
`);

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<meta charset="UTF-8">
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
77
<link rel="stylesheet" href="locobasic.css">
8-
<title>LocoBasic v0.5.0</title>
8+
<title>LocoBasic v0.5.1</title>
99
</head>
1010

1111
<body>

locoVmWorker.js

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

locoVmWorker.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

locobasic.js

Lines changed: 7 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

locobasic.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Semantics.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Semantics.js

Lines changed: 3 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Semantics.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)