mirror of
https://github.com/inexorabletash/jsbasic.git
synced 2024-12-22 07:30:19 +00:00
Add a few more samples
This commit is contained in:
parent
18c88661ac
commit
50c9355172
@ -125,6 +125,7 @@ By <a target=_blank href="mailto:inexorabletash@gmail.com">Joshua Bell</a>
|
|||||||
<option value="sample.pretzel"> Pretzel (Zee)</option>
|
<option value="sample.pretzel"> Pretzel (Zee)</option>
|
||||||
<option value="sample.3dcube"> 3D Rectangle (Tomo Wa)</option>
|
<option value="sample.3dcube"> 3D Rectangle (Tomo Wa)</option>
|
||||||
<option value="sample.enterprise"> Original Series Enterprise (Gil Keidar)</option>
|
<option value="sample.enterprise"> Original Series Enterprise (Gil Keidar)</option>
|
||||||
|
<option value="sample.colorrings"> Colored Rings (Miika Oja)</option>
|
||||||
|
|
||||||
<option disabled>____________________________________________</option>
|
<option disabled>____________________________________________</option>
|
||||||
<option disabled>Other</option>
|
<option disabled>Other</option>
|
||||||
@ -141,6 +142,7 @@ By <a target=_blank href="mailto:inexorabletash@gmail.com">Joshua Bell</a>
|
|||||||
<option value="sample.onelinetrain"> One Liner Train (Chris ten Den)</option>
|
<option value="sample.onelinetrain"> One Liner Train (Chris ten Den)</option>
|
||||||
<option value="sample.piglatin"> Pig Latin Translator (Gregg Buntin)</option>
|
<option value="sample.piglatin"> Pig Latin Translator (Gregg Buntin)</option>
|
||||||
<option value="sample.nuclear"> Nuclear Power Plant (Stephen R. Berggren c/o Kevin Riggle)</option>
|
<option value="sample.nuclear"> Nuclear Power Plant (Stephen R. Berggren c/o Kevin Riggle)</option>
|
||||||
|
<option value="sample.factors"> Prime Factors (Cristiano Trabuio)</option>
|
||||||
|
|
||||||
<option disabled>____________________________________________</option>
|
<option disabled>____________________________________________</option>
|
||||||
<option disabled>Traveller RPG Utilities</option>
|
<option disabled>Traveller RPG Utilities</option>
|
||||||
|
17
samples/sample.colorrings.txt
Normal file
17
samples/sample.colorrings.txt
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
210 hgr2
|
||||||
|
212 hcolor=1
|
||||||
|
240 A = 65
|
||||||
|
250 B = 10
|
||||||
|
260 R = 80
|
||||||
|
290 for sq=80to0 step -3.14159
|
||||||
|
292 u=360
|
||||||
|
293 co=int(rnd(1)*7)+1
|
||||||
|
295 if co=4 then goto 293
|
||||||
|
296 hcolor=co
|
||||||
|
300 FOR ALPHA = 0 TO 360 step 1
|
||||||
|
301 u=u+3.1411
|
||||||
|
310 X1 = INT(R-sq * COS(ALPHA-u) + 0.5)
|
||||||
|
320 Y1 = INT(R+sq * SIN(ALPHA+u) - 0.5)
|
||||||
|
330 HPLOT A + X1, B + Y1
|
||||||
|
340 NEXT ALPHA
|
||||||
|
350 next sq
|
18
samples/sample.factors.txt
Normal file
18
samples/sample.factors.txt
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
90 home
|
||||||
|
95 print "Enter a number to find its factors!"
|
||||||
|
97 print
|
||||||
|
100 input a
|
||||||
|
110 print
|
||||||
|
120 let f=0
|
||||||
|
140 if A/2=int(A/2) then let A=A/2: print "2x";: let f=1: goto 140
|
||||||
|
145 let i=3
|
||||||
|
150 let e=int(sqr(a)) + 2
|
||||||
|
155 let f=0
|
||||||
|
160 for n=i to e step 2
|
||||||
|
180 if a/n=int(a/n) then print n;"x";: let a=a/n: let i=n: let n=e: let f=1
|
||||||
|
200 next n
|
||||||
|
210 rem print a;" "; n;" "; i;" "; e;" ";f
|
||||||
|
220 if a>n and f<>0 then goto 155
|
||||||
|
230 print a
|
||||||
|
235 print
|
||||||
|
240 goto 100
|
Loading…
Reference in New Issue
Block a user