Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - bikemadness

Pages: [1] 2 3 4 5 6 7 8 ... 10
1
Yabasic / Re: Animated Words Maker
« on: April 05, 2026 »
The number ordering has a process I used that feels like an algorithm.
This  program is based on an app that did the word building on entry of letters.
But it animated the changes - cool I thought.
If I could even write algorithms, I would only need to write the words.

2
Yabasic / Animated Words Maker
« on: April 03, 2026 »
1300 words can be made with the letters I'm using.
Each combination has 2 to 4 words in a line.
Using about 350 different words in 150 lines.

Up or down D-pad to scroll through the list.
Or right D-pad to randomize.

Code: [Select]
dim n(1800)

for a=1 to 1800
read n(a)
next a

a$="ACEILNOPRTWY"

num=len(a$)
dim xs(num)
dim xm(num)

for a=1 to num
xs(a)=a
xm(a)=a
next a

keys=16
dim go(keys)
dim g(keys)

space=25
cen=(640-(len(a$))*space)/2-space
off=1

open window 640,512
repeat
setdrawbuf vm
vm=1-vm
setdispbuf vm
clear window
c=peek("port1")

for a=1 to keys
if and(c,2^(a-1))<>0 go(a)=1
if go(a)=1 g(a)=g(a)+1
if g(a)>2 g(a)=2
if g(a)=2 go(a)=0
if and(c,2^(a-1))=0 g(a)=0
next a

for a=1 to num
if xm(a)>xs(a) xm(a)=xm(a)-0.1
if xm(a)<xs(a) xm(a)=xm(a)+0.1
next a

if go(5)=1 sel=sel-12
if sel<0 sel=1788

if go(7)=1 sel=sel+12
if sel>1788 sel=0

if go(6)=1 sel=int(ran(150)+1)*12
if off=1 text 470,124,str$((sel/12)+1,"###")

if go(8)=1 off=off+1
if off>2 off=1

for a=1+sel to num+sel
xs(a-sel)=n(a)
next a

for a=1 to num
if off=2 text xm(a)*space+cen,100,str$(xs(a))
text xm(a)*space+cen,124,mid$(a$,a,1)
if off=2 text xm(a)*space+cen,148,str$(n(a))
next a

if off=1 text 10,12,"key pad left for info"
if off=2 then
text 10,12,"line "+str$((sel/12)+1,"###")
text 10,24,"  up list-key pad up"
text 10,36,"down list-key pad down"
text 10,48,"   random-key pad right"
text 10,60," info off-key pad left"
endif

until (1=0)

data 1,2,3,4,5,6,7,8,9,10,11,12 rem aceilnoprtwy
data 5,1,2,6,8,7,11,10,3,4,12,9 rem certainlypow
data 8,10,4,1,7,2,11,6,5,3,12,9 rem interplaycow
data 7,4,5,8,6,9,2,1,3,11,10,12 rem porcelainwty
data 6,1,5,10,7,3,2,11,9,8,4,12 rem conwealtripy 5
data 2,8,7,3,11,4,10,1,6,5,9,12 rem paintrecwoly
data 7,10,4,8,1,9,2,6,5,11,3,12 rem lowerpaincty
data 1,10,4,3,2,5,7,6,8,9,11,12 rem alienportcwy
data 11,7,8,6,5,12,3,10,2,1,4,9 rem trowliceypan
data 5,9,7,2,3,1,10,11,8,6,4,12 rem nilwatercopy 10
data 7,1,4,11,9,3,2,12,6,5,8,10 rem conetrawlyip
data 2,8,9,7,11,4,5,10,3,6,1,12 rem warnoticeply
data 3,7,8,6,2,5,12,1,9,10,11,4 rem playnicertwo
data 10,7,12,5,9,6,2,8,1,11,3,4 rem rowyincplate
data 2,1,8,6,10,3,11,9,5,7,4,12 rem canwriteploy 15
data 2,12,5,11,1,7,9,10,6,8,3,4 rem lawyerntopic
data 9,1,6,12,10,7,2,11,5,8,3,4 rem cowyrentalpi
data 6,9,11,7,8,3,2,5,10,1,12,4 rem tonypailcrew
data 9,2,7,1,10,8,4,6,3,11,5,12 rem icrowpenalty
data 7,10,2,8,9,1,11,12,6,5,3,4 rem newytrailcop 20
data 8,6,1,10,7,2,4,5,9,11,3,12 rem enwopclarity
data 8,1,7,10,6,4,2,5,3,11,9,12 rem cornpleawity
data 4,3,12,10,1,5,6,7,11,8,9,2 rem lycanoptwire
data 10,7,8,6,12,1,2,4,5,3,11,9 rem notpriceyawl
data 6,7,8,10,5,4,2,11,3,1,9,12 rem tornlacewipy 25
data 2,9,8,10,1,4,6,7,5,11,3,12 rem lawnropecity
data 7,9,2,11,12,6,10,4,1,3,8,5 rem reptynawcoil
data 2,3,4,6,5,11,9,7,1,8,10,12 rem raceliptowny
data 2,4,5,11,1,6,9,8,3,12,10,7 rem larcenypowit
data 3,1,8,10,9,12,11,7,2,5,4,6 rem crawtypelion 30
data 3,5,8,10,9,11,6,7,2,12,1,4 rem wraycopelint
data 6,4,12,1,8,3,2,11,5,9,7,10 rem ioncrawltype
data 6,5,8,10,9,4,2,7,3,11,1,12 rem worncapelity
data 11,5,10,4,9,3,2,12,7,1,6,8 rem tonicwryleap
data 11,9,4,6,10,7,2,12,3,5,1,8 rem woretinyclap 35
data 7,9,12,10,3,5,4,1,6,11,8,2 rem pylonrawcite
data 11,1,5,3,2,4,8,10,7,6,12,9 rem clinetroypaw
data 10,1,6,3,2,9,4,7,11,8,5,12 rem clioweptnary
data 2,9,6,11,7,12,10,8,3,4,1,5 rem wartyelpcoin
data 10,4,9,2,11,3,7,6,8,12,1,5 rem wincyporealt 40
data 2,3,12,10,11,8,6,9,1,5,7,4 rem racytownpile
data 2,9,11,8,3,7,6,1,5,4,12,10 rem paltronicyew
data 10,7,8,6,3,11,1,9,5,12,2,4 rem owlyricepant
data 1,8,9,7,10,3,11,5,6,12,2,4 rem awnypricelot
data 3,11,12,10,5,7,8,1,2,9,4,6 rem prawlynotice 45
data 2,11,12,9,6,10,5,1,4,3,8,7 rem patrolywince
data 9,5,6,4,3,11,2,1,8,7,10,12 rem policetrawny
data 10,8,12,6,5,7,2,1,9,11,3,4 rem powylincrate
data 10,3,4,11,12,8,6,5,7,9,1,2 rem wyceporntail
data 10,11,12,4,2,5,8,1,9,6,7,3 rem plyintworace 50
data 6,9,12,2,11,8,10,1,7,3,5,4 rem pitywarncole
data 7,1,12,10,9,11,2,8,6,3,5,4 rem cotywrapline
data 6,5,4,2,11,10,9,3,7,8,1,12 rem wipecartonly
data 7,5,4,2,10,3,11,9,6,12,1,8 rem winecrayplot
data 3,11,12,10,1,4,2,5,6,8,9,7 rem loanprytwice 55
data 6,7,8,10,2,5,3,1,11,9,4,12 rem plownacetiry
data 5,9,7,1,10,6,11,12,3,2,8,4 rem itryanewclop
data 2,8,4,7,1,12,11,5,6,3,10,9 rem latepricywon
data 6,11,12,10,5,3,2,8,9,4,1,7 rem wontlayprice
data 9,3,11,2,12,10,6,8,1,5,7,4 rem ricytowpanel 60
data 1,4,11,6,5,2,9,8,12,7,10,3 rem anyclitpower
data 2,4,5,11,6,12,8,1,3,7,10,9 rem parceltoywin
data 3,6,2,11,7,12,8,10,4,9,1,5 rem wearyclotpin
data 11,1,4,2,5,8,6,10,7,3,12,9 rem citelornypaw
data 7,10,2,8,9,6,11,1,3,4,12,5 rem pertynailcow 65
data 2,9,8,11,10,5,6,12,3,7,1,4 rem warynoteclip
data 6,1,12,10,3,11,2,8,7,5,9,4 rem colytarpwine
data 7,3,6,2,9,8,11,5,10,12,1,4 rem wicypenalrot
data 9,1,11,5,8,6,2,4,12,7,3,10 rem cowpintlayer
data 6,2,9,1,8,10,4,7,3,11,5,12 rem icrowaplenty 70
data 8,3,4,2,12,1,10,5,6,9,11,7 rem nicepryatowl
data 6,11,12,10,9,3,2,1,7,8,5,4 rem ponywartlice
data 10,9,12,2,4,3,7,1,6,11,8,5 rem pinlyrowcate
data 6,11,12,9,1,10,2,8,5,4,3,7 rem lowtraypince
data 2,9,12,7,1,4,10,8,6,11,3,5 rem lawnyripcote 75
data 2,9,8,11,10,4,6,12,5,7,3,1 rem tawnroteclip
data 6,7,11,9,5,3,2,10,12,1,8,4 rem tonylacwiper
data 2,7,12,6,11,4,10,9,3,5,1,8 rem warnticypole
data 2,3,4,10,9,11,6,1,7,8,5,12 rem pacewortliny
data 11,8,5,7,10,6,3,12,2,4,1,9 rem wrotenicylap 80
data 7,1,9,11,8,4,2,6,3,12,10,5 rem cornypalewit
data 7,5,2,10,6,11,12,1,3,4,9,8 rem pertclaywino
data 7,6,2,11,4,8,5,12,10,9,3,1 rem yewlocantrip
data 6,3,4,10,11,2,1,5,7,8,9,12 rem oncepartwily
data 3,4,5,7,9,8,10,6,2,1,11,12 rem tracepinlowy 85
data 9,8,7,5,1,6,2,4,10,11,3,12 rem lowpinecarty
data 3,11,5,10,9,8,6,4,2,1,7,12 rem trapeownlicy
data 7,8,5,1,11,4,2,10,6,9,3,12 rem iowneractply
data 6,7,8,2,3,12,11,5,9,4,1,10 rem wiltpaceryon
data 11,4,5,3,10,12,7,9,2,1,8,6 rem triceyowplan 90
data 7,1,12,10,4,9,2,5,6,11,3,8 rem cowlpraynite
data 8,9,3,6,11,7,10,1,2,12,5,4 rem preywinacolt
data 11,5,4,2,6,3,7,9,10,8,1,12 rem wineclotpray
data 5,1,2,6,9,7,10,8,3,4,11,12 rem certainplowy
data 9,4,11,2,8,3,5,7,12,6,1,10 rem wincotplayer 95
data 2,4,5,6,7,11,9,3,10,1,8,12 rem tapceilworny
data 7,9,5,11,10,1,2,6,3,12,4,8 rem norwepayclit
data 11,4,3,2,1,8,6,10,5,12,7,9 rem liecrownypat
data 3,2,11,1,9,12,7,5,6,4,8,10 rem icatprowlyen
data 11,5,6,4,12,7,8,10,2,1,9,3 rem tryicenowpal 100
data 2,6,8,5,7,9,10,1,3,4,11,12 rem particlenowy
data 7,5,10,3,2,11,4,1,9,12,6,8 rem pliocwayrent
data 5,8,4,2,6,3,10,7,9,1,11,12 rem tinealpcrowy
data 10,3,6,5,4,7,2,12,11,8,9,1 rem yoclientwarp
data 7,9,3,1,6,4,11,12,10,5,2,8 rem iwentlaycrop 105
data 5,4,9,2,8,10,3,7,1,11,6,12 rem riocawplenty
data 6,5,4,2,1,7,11,9,10,3,12,8 rem litecanyprow
data 8,9,6,2,3,7,11,5,12,10,1,4 rem wilypenactor
data 3,10,8,11,12,9,1,7,4,5,2,6 rem owartypencil
data 8,4,5,2,12,3,11,7,10,9,1,6 rem winceypatrol 110
data 5,2,8,1,12,6,11,7,10,9,4,3 rem icywanpetrol
data 3,1,10,11,2,12,8,6,7,9,4,5 rem clawyprotein
data 8,6,1,5,11,10,3,7,2,4,9,12 rem eroticpawnly
data 2,9,8,6,7,3,10,11,1,4,5,12 rem rantwilecopy
data 6,7,11,10,9,1,2,5,12,4,3,8 rem nowtpacylier 115
data 1,2,9,4,11,6,5,10,8,3,7,12 rem actionwreply
data 10,3,9,2,5,12,6,1,11,4,7,8 rem pictlowyearn
data 11,1,7,3,2,8,4,12,10,9,5,6 rem cliowyentrap
data 7,6,2,5,4,8,11,3,1,9,12,10 rem replicantyow
data 1,6,7,4,8,5,11,2,3,10,12,9 rem aprincelytow 120
data 11,10,7,9,8,12,2,6,3,4,1,5 rem wortypelican
data 4,5,3,11,6,12,8,10,2,1,9,7 rem treaclyowpin
data 3,7,2,11,5,1,8,10,4,12,9,6 rem nearlycowpit
data 11,10,2,8,9,7,5,1,12,4,3,6 rem pewtoynilcar
data 5,1,9,11,12,6,2,8,10,7,4,3 rem coywantperil 125
data 10,2,1,5,9,11,3,8,6,12,4,7 rem ecowiryplant
data 9,12,2,11,3,10,6,8,7,4,1,5 rem weltyorpanic
data 2,3,4,10,9,11,6,1,7,8,5,12 rem pacewortliny
data 11,10,4,2,12,3,6,5,7,8,1,9 rem wineportycal
data 11,9,2,3,4,5,6,12,10,7,1,8 rem weilnotycrap 130
data 7,11,12,2,3,10,9,8,6,4,1,5 rem wiltyraponce
data 3,1,9,10,2,4,7,8,6,5,11,12 rem clantropeiwy
data 10,11,8,2,1,3,6,4,5,9,7,12 rem linprowetacy
data 5,9,3,11,4,6,7,12,8,10,1,2 rem wyelanorctip
data 11,9,8,6,3,12,2,7,5,4,1,10 rem woltripecyan 135
data 2,8,9,6,12,7,11,4,5,10,3,1 rem yawprincetol
data 2,12,7,5,1,6,11,10,8,3,4,9 rem latwinerypoc
data 2,1,4,12,11,7,6,5,3,8,9,10 rem carepontwyli
data 7,8,3,11,5,4,1,2,10,12,9,6 rem openlyacwrit
data 6,9,3,10,7,4,1,2,11,8,5,12 rem openwaltciry 140
data 7,10,4,8,9,1,2,3,11,5,6,12 rem nopetwailcry
data 7,4,9,2,6,8,11,12,3,10,1,5 rem wircylanetop
data 11,1,9,7,2,4,3,12,8,10,6,5 rem clonywiretap
data 5,8,12,3,9,11,10,7,2,1,6,4 rem triyawpclone
data 2,10,11,9,8,4,7,6,12,1,3,5 rem tawnypolicer 145
data 2,11,12,10,9,4,8,7,5,1,3,6 rem tawnrypolice
data 8,11,6,4,3,10,2,1,9,5,7,12 rem politewarncy
data 5,11,2,10,9,3,8,7,6,4,1,12 rem wentarpolicy
data 11,5,8,3,10,4,6,9,7,1,2,12 rem twincoreplay
data 11,6,8,5,10,4,1,9,7,3,2,12 rem owtnicreplay 150


3
Yabasic / Animated Lotto
« on: April 03, 2026 »
I wanted to do this years ago.
Couldn't even imagine how to code it.
Tried with various coding methods I'd learnt.
Finally got it.

It does a few things using the D-pad.
Down does the basic operation.
Left shows the last 20 randoms.

Code: [Select]
num=40

dim xs(num)
dim ys(num)
dim xe(num)
dim ye(num)

row=0
col=1
for a=1 to num
row=row+1
if row>8 then
col=col+1
row=1
endif
xs(a)=row*30+185
ys(a)=col*30+60
xe(a)=row*30+185
ye(a)=col*30+60
next a

amount=6
dim lot(amount)

b=20
a=6
dim lit(b,a)

dim shade(20)
for a=1 to 20
if frac(a/2)=0 shade(a)=50
if frac(a/2)=.5 shade(a)=100
next a

keys=16
dim go(keys)
dim g(keys)

shape=3
off=1
t=0
count=200
stop=1

open window 640,512
repeat
setdrawbuf vm
vm=1-vm
setdispbuf vm
clear window
c=peek("port1")

for a=1 to keys
if and(c,2^(a-1))<>0 go(a)=1
if go(a)=1 g(a)=g(a)+1
if g(a)>2 g(a)=2
if g(a)=2 go(a)=0
if and(c,2^(a-1))=0 g(a)=0
next a

if go(6)=1 stop=stop+1
if stop>2 stop=1
if stop=1 sp=2
if stop=2 sp=0

if go(8)=1 off=off+1
if off>3 off=1

if go(5)=1 shape=shape+1
if shape>3 shape=1

if go(7)=1 then
for b=1 to amount
0 lot(b)=int(ran(40))+1
for a=1 to b
if a<>b if lot(b)=lot(a) goto 0
next a
next b
endif

if go(7)=1 t=t+1
if t>20 t=1
for b=1 to 20
for a=1 to 6
if t=b lit(b,a)=lot(a)
next a
next b

if go(6)=1 t=0
for b=1 to 20
for a=1 to 6
if go(6)=1 lit(b,a)=0
next a
next b

for a=1 to 20
setrgb 1,shade(a),shade(a),shade(a)
if off=3 fill rectangle 205,a*11+271 to 445,a*11+282
next a

for b=1 to 20
for a=1 to 6
if t=b setrgb 1,0,256,0
if t<>b setrgb 1,256,256,256
if off=2 or off=3 text a*42+167,b*11+280,str$(lit(b,a),"##")
next a
next b

row=0
if go(7)=1 if count=200 then
count=0
for b=1 to num
for a=1 to amount
if lot(a)=b then
row=row+1
xe(b)=row*42+175
ye(b)=260
endif
next a
next b
endif

count=count+1
if count>200 count=200

row=0
col=1
if count=200 then
for a=1 to num
row=row+1
if row>8 then
col=col+1
row=1
endif
xe(a)=row*30+185
ye(a)=col*30+60
next a
endif

for a=1 to num
if xs(a)>xe(a) xs(a)=xs(a)-sp
if xs(a)<xe(a) xs(a)=xs(a)+sp
if ys(a)>ye(a) ys(a)=ys(a)-sp
if ys(a)<ye(a) ys(a)=ys(a)+sp
next a

setrgb 1,256,256,256
for a=1 to num
text xs(a)-10,ys(a)+3,str$(a,"##")
if a<10 text xs(a)-10,ys(a)+3,"0"
if shape=2 rectangle xs(a)-15,ys(a)-15 to xs(a)+15,ys(a)+15
if shape=1 circle xs(a),ys(a),15
next a

for b=1 to num
for a=1 to amount
if lot(a)=b then
if count<200 setrgb 1,0,256,0
if stop=1 setrgb 1,256,256,256
text xs(b)-10,ys(b)+3,str$(b,"##")
if b<10 text xs(b)-10,ys(b)+3,"0"
endif
next a
next b

setrgb 1,256,256,256
x=0
y=1
for a=1 to num
x=x+1
if x>8 then
y=y+1
x=1
endif
if shape=3 rectangle x*30-15+185,y*30-15+60 to x*30+15+185,y*30+15+60
next a

until (1=0)

4
I had long forgotten my password when trying to login - in windows 10.
Then I remembered.
I had been using windows 7, which had the password.
I still had laptop with windows 7.
Relief.

5
General chat / Logging in
« on: June 12, 2025 »
Google saves passwords for automatic login.
A good thing because I have no idea what mine is now.
I had been trying to log in up until a few weeks ago.
And I couldn't.
It seemed google lost the dbf password.
It actually didn't have it - in windows 10.
So I brushed off a mini-laptop still loaded with windows 7.
My recent posts have made with the mini.
It's fifteen years old and luckily still reliable.
Interesting.

6
Yabasic / Orbiting Planets
« on: June 09, 2025 »
I reverse engineered an old program with the only sample
of sorting I found. It's easier to use and understand.
This is my first moving graphic. Just one axis and no perspective.
Up arrow - change direction/stop
Left arrow - random postion
Right arrow - change view
Down arrow - change colour/no colour

Code: [Select]
open window 640,512
x=320
y=256
ang=pi/180
rain=20
dim R(rain)
dim G(rain)
dim B(rain)
dim dir(rain)
dim dist(rain)
dim sp(rain)
dim x1(rain)
dim y1(rain)
dim size(rain)
dim order$(rain)

for a=1 to rain
R(a)=int(ran(200))
G(a)=int(ran(200))
B(a)=int(ran(200))
dir(a)=int(ran(360))
dist(a)=int(ran(15))*20+20
next a

shape=4
turn=2
col=1

keys=16
dim go(keys)
dim g(keys)

key=16
dim go1(key)

repeat
setdrawbuf vm
vm=1-vm
setdispbuf vm
clear window
c=peek("port1")

for a=1 to keys
if and(c,2^(a-1))<>0 go(a)=1
if go(a)=1 g(a)=g(a)+1
if g(a)>2 g(a)=2
if g(a)=2 go(a)=0
if and(c,2^(a-1))=0 g(a)=0
next a

for a=1 to key
if and(c,2^(a-1))<>0 go1(a)=1
if and(c,2^(a-1))=0 go1(a)=0
next a

if go(6)=1 shape=shape+1
if shape>4 shape=1
text 12,24,str$(shape)

if go(5)=1 turn=turn+1
if turn>4 turn=1

if go(7)=1 col=col+1
if col>2 col=1

for a=1 to rain
if turn=3 or turn=1 dir(a)=dir(a)+0
if turn=2 dir(a)=dir(a)+sp(a)
if dir(a)>359 dir(a)=0
if turn=4 dir(a)=dir(a)-sp(a)
if dir(a)<0 dir(a)=359
next a

for a=1 to rain
if shape=5 then
dir(a)=a*(360/rain)
dist(a)=200
endif
next a

for a=1 to rain
if go(8)=1 then
dir(a)=int(ran(360))
dist(a)=int(ran(230))+20
endif
next a

for a=1 to rain
order$(a)=str$(size(a))
next a

for k=1 to rain-1
for j=1 to rain-k

if order$(j)>order$(j+1) then

temp=size(j)
size(j)=size(j+1)
size(j+1)=temp

temp=R(j)
R(j)=R(j+1)
R(j+1)=temp

temp=G(j)
G(j)=G(j+1)
G(j+1)=temp

temp=B(j)
B(j)=B(j+1)
B(j+1)=temp

temp=dir(j)
dir(j)=dir(j+1)
dir(j+1)=temp

temp=dist(j)
dist(j)=dist(j+1)
dist(j+1)=temp

temp=x1(j)
x1(j)=x1(j+1)
x1(j+1)=temp

temp=y1(j)
y1(j)=y1(j+1)
y1(j+1)=temp

temp$=order$(j)
order$(j)=order$(j+1)
order$(j+1)=temp$

endif

next j
next k

for a=1 to rain
x1(a)=cos(dir(a)*ang)*dist(a)+320
y1(a)=sin(dir(a)*ang)*dist(a)+256
sp(a)=25/dist(a)
size(a)=(y1(a)/500)*3
next a

for a=1 to rain
if shape=1 line x,y to x1(a),y1(a)
if shape=2 then
if col=1 or col=2 then
setrgb 1,256,256,256
circle x1(a),y1(a),15
endif
if col=2 then
setrgb 1,R(a),G(a),B(a)
fill circle x1(a),y1(a),14
endif
endif
if shape=3 then
setrgb 1,256,256,256
text x1(a),y1(a),"*"
endif
if shape=4 then
fill circle x1(a),256,12*size(a)
if col=1 setrgb 1,0,0,0
if col=2 setrgb 1,R(a),G(a),B(a)
fill circle x1(a),256,11*size(a)
setrgb 1,256,256,256
endif
'if shape=5 line x1(a),10*size(a)+240 to x1(a),10*size(a)+270
next a

text 0,12,str$(dir(1),"###")

until (1=0)


7
Yabasic is just perfect. The emulator just made it better.
I found the emulator before dbf went live and copies of
the first only download have been loaded on all computers
I've owned. My first program was my biggest. It took 3
months to write, get it to run and debug it and it was
written on PS2 console yabasic. When the emulator
came along, I baulked at having to re-type it.
Then I heard that memory cards could be tranferred to computer.
So I asked Jim about it. He had the gear. I sent him 3
years of work and he put it on this site.
I have copies of that everywhere too.
I have written far more since then and my best stuff
is on this site. I wished there coding samples when I started.

8
Yabasic / Ants
« on: June 01, 2025 »
Yes. The creepy crawlies.
Don't show this to your girlfriend.

Code: [Select]
open window 640,512
setrgb 0,255,255,255
fill rectangle 0,0 to 640,512
l=5
fly=100
dim flyx(fly),flyy(fly)
dim a(fly),k(fly),e(fly),c(fly),f(fly),d(fly)
for m=1 to fly
flyx(m)=int(ran(640))
flyy(m)=int(ran(512))
next m
repeat
setdrawbuf dw
dw=1-dw
setdispbuf dw
clear window
for m=1 to fly
setrgb 1,0,0,0
k(m)=a(m)
label move
a(m)=int(ran(36))
if (a(m)>k(m)-34 and a(m)<k(m)-2) goto move
if (a(m)>k(m)+2 and a(m)<k(m)+34) goto move
e(m)=c(m)
f(m)=d(m)
if ((e(m)+320)>640) e(m)=-320
if ((e(m)+320)<0) e(m)=320
if ((f(m)+256)>512) f(m)=-256
if ((f(m)+256)<0) f(m)=256
c(m)=(cos(10*(pi/180)*a(m))*l)+e(m)
d(m)=(sin(10*(pi/180)*a(m))*l)+f(m)
fill circle flyx+e(m)+320,flyy+f(m)+256,3
fill circle flyx+c(m)+320,flyy+d(m)+256,3
next m
until (1=0)


9
Yabasic / tic tac toe play sheet
« on: June 01, 2025 »
key-board instead a sheet of paper.
the keys can be any group of letters
or the number pad and still, eg "1".
via the data string.

Code: [Select]
restore select
read sum
dim num$(sum)
for a=1 to sum
read num$(a)
next a

restore title
read blx
dim lit$(blx)
for a=1 to blx
read lit$(a)
next a

blox=9
dim lt$(blox)
dim x(blox)
dim y(blox)
dim z(blox)

for a=1 to blox
z(a)=3
next a

word=4

open window 640,512
repeat
setdrawbuf vm
vm=1-vm
setdispbuf vm
clear window

g$=inkey$(0)

'if g$="q" word=word+1
'if word>blx word=1

gridx=0
gridy=150

for a=1 to blox
gridx=gridx+50
if gridx>150 then
gridx=50
gridy=gridy+50
endif

x1=x(a)+gridx+100-24
y1=y(a)+gridy-24
x2=x(a)+gridx+100+24
y2=y(a)+gridy+24
rectangle x1,y1 to x2,y2
setrgb 1,150,150,150
text x1+18,y1+27,num$(a)
setrgb 1,256,256,256

if g$=num$(a) x=x+1
if x>2 x=1

if g$=num$(a) z(a)=x

if g$="t" z(a)=3
text 140,110,"'t' to clear"

if z(a)=1 or z(a)=2 clear fill rectangle x1+5,y1+5 to x2-5,y2-5

if z(a)=1 lt$(a)="O"
if z(a)=2 lt$(a)="X"
if z(a)=3 lt$(a)=""

text x(a)+gridx+100-5,y(a)+gridy+5,lt$(a)

next a

for a=1 to blx
x1=0
y1=150

for b=1 to len(lit$(a))
x1=x1+50
if x1>150 then
x1=50
y1=y1+50
endif
if word=a text x1+95,y1+5,mid$(lit$(a),b,1)
next b
next a

until (1=0)

label select
data 9
data "w","e","r","a","s","d","z","x","c"

label title
data 4
data "TICTACTOE"
data "PLAYERONE"
data "PLAYERTWO"
data "         "



10
Yabasic / Word Unscramble
« on: June 01, 2025 »
I haven't figured out a shorter code.
Here's the long version.
D-pad (right) to randomize.

Code: [Select]
dim xl$(12),xn1(12),xn2(12),xn3(12),xn4(12)
dim xn5(12),xn6(12),xn7(12),xn8(12),xn9(12)
dim xn10(12),xn11(12),xn12(12),xn13(12)
dim xn14(12),xn15(12),xn16(12),xn17(12)
dim xn18(12),xn19(12),xn20(12),xn21(12)
dim xn22(12),xn23(12),xn24(12),xn25(12)
dim xn26(12),xn27(12),xn28(12),xn29(12)
dim xn30(12),xn31(12),xn32(12),xn33(12)
dim xn34(12),xn35(12),xn36(12),xn37(12)
dim xn38(12),xn39(12),xn40(12),xn41(12)
dim xn42(12),xn43(12),xn44(12),xn45(12)
dim xn46(12),xn47(12),xn48(12),xn49(12)
dim xn50(12),xn51(12),xn52(12),xn53(12)
dim xn54(12),xn55(12),xn56(12),xn57(12)
dim xn58(12),xn59(12),xn60(12),xn61(12)
dim xn62(12),xn63(12),xn64(12),xn65(12)
dim xn66(12),xn67(12),xn68(12),xn69(12)
dim xn70(12),xn71(12),xn72(12),xn73(12)
dim xn74(12),xn75(12),xn76(12),xn77(12)
dim xn78(12),xn79(12),xn80(12),xn81(12)
dim xn82(12),xn83(12),xn84(12),xn85(12)
dim xn86(12),xn87(12),xn88(12),xn89(12)
dim xn90(12),xn91(12),xn92(12),xn93(12)
dim xn94(12),xn95(12),xn96(12),xn97(12)
dim xn98(12),xn99(12),xn100(12),xn101(12)
dim xn102(12),xn103(12),xn104(12),xn105(12)
dim xn106(12),xn107(12),xn108(12),xn109(12),xn110(12)

for a=1 to 12:read xl$(a):next a
for a=1 to 12:read xn1(a):next a
for a=1 to 12:read xn2(a):next a
for a=1 to 12:read xn3(a):next a
for a=1 to 12:read xn4(a):next a
for a=1 to 12:read xn5(a):next a
for a=1 to 12:read xn6(a):next a
for a=1 to 12:read xn7(a):next a
for a=1 to 12:read xn8(a):next a
for a=1 to 12:read xn9(a):next a
for a=1 to 12:read xn10(a):next a
for a=1 to 12:read xn11(a):next a
for a=1 to 12:read xn12(a):next a
for a=1 to 12:read xn13(a):next a
for a=1 to 12:read xn14(a):next a
for a=1 to 12:read xn15(a):next a
for a=1 to 12:read xn16(a):next a
for a=1 to 12:read xn17(a):next a
for a=1 to 12:read xn18(a):next a
for a=1 to 12:read xn19(a):next a
for a=1 to 12:read xn20(a):next a
for a=1 to 12:read xn21(a):next a
for a=1 to 12:read xn22(a):next a
for a=1 to 12:read xn23(a):next a
for a=1 to 12:read xn24(a):next a
for a=1 to 12:read xn25(a):next a
for a=1 to 12:read xn26(a):next a
for a=1 to 12:read xn27(a):next a
for a=1 to 12:read xn28(a):next a
for a=1 to 12:read xn29(a):next a
for a=1 to 12:read xn30(a):next a
for a=1 to 12:read xn31(a):next a
for a=1 to 12:read xn32(a):next a
for a=1 to 12:read xn33(a):next a
for a=1 to 12:read xn34(a):next a
for a=1 to 12:read xn35(a):next a
for a=1 to 12:read xn36(a):next a
for a=1 to 12:read xn37(a):next a
for a=1 to 12:read xn38(a):next a
for a=1 to 12:read xn39(a):next a
for a=1 to 12:read xn40(a):next a
for a=1 to 12:read xn41(a):next a
for a=1 to 12:read xn42(a):next a
for a=1 to 12:read xn43(a):next a
for a=1 to 12:read xn44(a):next a
for a=1 to 12:read xn45(a):next a
for a=1 to 12:read xn46(a):next a
for a=1 to 12:read xn47(a):next a
for a=1 to 12:read xn48(a):next a
for a=1 to 12:read xn49(a):next a
for a=1 to 12:read xn50(a):next a
for a=1 to 12:read xn51(a):next a
for a=1 to 12:read xn52(a):next a
for a=1 to 12:read xn53(a):next a
for a=1 to 12:read xn54(a):next a
for a=1 to 12:read xn55(a):next a
for a=1 to 12:read xn56(a):next a
for a=1 to 12:read xn57(a):next a
for a=1 to 12:read xn58(a):next a
for a=1 to 12:read xn59(a):next a
for a=1 to 12:read xn60(a):next a
for a=1 to 12:read xn61(a):next a
for a=1 to 12:read xn62(a):next a
for a=1 to 12:read xn63(a):next a
for a=1 to 12:read xn64(a):next a
for a=1 to 12:read xn65(a):next a
for a=1 to 12:read xn66(a):next a
for a=1 to 12:read xn67(a):next a
for a=1 to 12:read xn68(a):next a
for a=1 to 12:read xn69(a):next a
for a=1 to 12:read xn70(a):next a
for a=1 to 12:read xn71(a):next a
for a=1 to 12:read xn72(a):next a
for a=1 to 12:read xn73(a):next a
for a=1 to 12:read xn74(a):next a
for a=1 to 12:read xn75(a):next a
for a=1 to 12:read xn76(a):next a
for a=1 to 12:read xn77(a):next a
for a=1 to 12:read xn78(a):next a
for a=1 to 12:read xn79(a):next a
for a=1 to 12:read xn80(a):next a
for a=1 to 12:read xn81(a):next a
for a=1 to 12:read xn82(a):next a
for a=1 to 12:read xn83(a):next a
for a=1 to 12:read xn84(a):next a
for a=1 to 12:read xn85(a):next a
for a=1 to 12:read xn86(a):next a
for a=1 to 12:read xn87(a):next a
for a=1 to 12:read xn88(a):next a
for a=1 to 12:read xn89(a):next a
for a=1 to 12:read xn90(a):next a
for a=1 to 12:read xn91(a):next a
for a=1 to 12:read xn92(a):next a
for a=1 to 12:read xn93(a):next a
for a=1 to 12:read xn94(a):next a
for a=1 to 12:read xn95(a):next a
for a=1 to 12:read xn96(a):next a
for a=1 to 12:read xn97(a):next a
for a=1 to 12:read xn98(a):next a
for a=1 to 12:read xn99(a):next a
for a=1 to 12:read xn100(a):next a
for a=1 to 12:read xn101(a):next a
for a=1 to 12:read xn102(a):next a
for a=1 to 12:read xn103(a):next a
for a=1 to 12:read xn104(a):next a
for a=1 to 12:read xn105(a):next a
for a=1 to 12:read xn106(a):next a
for a=1 to 12:read xn107(a):next a
for a=1 to 12:read xn108(a):next a
for a=1 to 12:read xn109(a):next a
for a=1 to 12:read xn110(a):next a

dim g(16)
dim go(16)

dim x(12),x1(12)
for a=1 to 12
x(a)=a*15+215
'x1(a)=x(a)
xn1(a)=x(a)
next a

wrd=1
num=1

open window 640,512
repeat
setdrawbuf vm
vm=1-vm
setdispbuf vm
clear window
c=peek("port1")

for a=1 to 16
if and(c,2^(a-1))<>0 go(a)=1
if go(a)=1 g(a)=g(a)+1
if g(a)>2 g(a)=2
if g(a)=2 go(a)=0
if and(c,2^(a-1))=0 g(a)=0
next a

if go(5)=1 wrd=wrd-1
if wrd<1 wrd=110
if go(7)=1 wrd=wrd+1
if wrd>110 wrd=1

if go(6)=1 then
num=int(ran(110))+1
wrd=num
endif

for a=1 to 12
if wrd=1 x1(a)=xn1(a)
if wrd=2 x1(a)=xn2(a)
if wrd=3 x1(a)=xn3(a)
if wrd=4 x1(a)=xn4(a)
if wrd=5 x1(a)=xn5(a)
if wrd=6 x1(a)=xn6(a)
if wrd=7 x1(a)=xn7(a)
if wrd=8 x1(a)=xn8(a)
if wrd=9 x1(a)=xn9(a)
if wrd=10 x1(a)=xn10(a)
if wrd=11 x1(a)=xn11(a)
if wrd=12 x1(a)=xn12(a)
if wrd=13 x1(a)=xn13(a)
if wrd=14 x1(a)=xn14(a)
if wrd=15 x1(a)=xn15(a)
if wrd=16 x1(a)=xn16(a)
if wrd=17 x1(a)=xn17(a)
if wrd=18 x1(a)=xn18(a)
if wrd=19 x1(a)=xn19(a)
if wrd=20 x1(a)=xn20(a)
if wrd=21 x1(a)=xn21(a)
if wrd=22 x1(a)=xn22(a)
if wrd=23 x1(a)=xn23(a)
if wrd=24 x1(a)=xn24(a)
if wrd=25 x1(a)=xn25(a)
if wrd=26 x1(a)=xn26(a)
if wrd=27 x1(a)=xn27(a)
if wrd=28 x1(a)=xn28(a)
if wrd=29 x1(a)=xn29(a)
if wrd=30 x1(a)=xn30(a)
if wrd=31 x1(a)=xn31(a)
if wrd=32 x1(a)=xn32(a)
if wrd=33 x1(a)=xn33(a)
if wrd=34 x1(a)=xn34(a)
if wrd=35 x1(a)=xn35(a)
if wrd=36 x1(a)=xn36(a)
if wrd=37 x1(a)=xn37(a)
if wrd=38 x1(a)=xn38(a)
if wrd=39 x1(a)=xn39(a)
if wrd=40 x1(a)=xn40(a)
if wrd=41 x1(a)=xn41(a)
if wrd=42 x1(a)=xn42(a)
if wrd=43 x1(a)=xn43(a)
if wrd=44 x1(a)=xn44(a)
if wrd=45 x1(a)=xn45(a)
if wrd=46 x1(a)=xn46(a)
if wrd=47 x1(a)=xn47(a)
if wrd=48 x1(a)=xn48(a)
if wrd=49 x1(a)=xn49(a)
if wrd=50 x1(a)=xn50(a)
if wrd=51 x1(a)=xn51(a)
if wrd=52 x1(a)=xn52(a)
if wrd=53 x1(a)=xn53(a)
if wrd=54 x1(a)=xn54(a)
if wrd=55 x1(a)=xn55(a)
if wrd=56 x1(a)=xn56(a)
if wrd=57 x1(a)=xn57(a)
if wrd=58 x1(a)=xn58(a)
if wrd=59 x1(a)=xn59(a)
if wrd=60 x1(a)=xn60(a)
if wrd=61 x1(a)=xn61(a)
if wrd=62 x1(a)=xn62(a)
if wrd=63 x1(a)=xn63(a)
if wrd=64 x1(a)=xn64(a)
if wrd=65 x1(a)=xn65(a)
if wrd=66 x1(a)=xn66(a)
if wrd=67 x1(a)=xn67(a)
if wrd=68 x1(a)=xn68(a)
if wrd=69 x1(a)=xn69(a)
if wrd=70 x1(a)=xn70(a)
if wrd=71 x1(a)=xn71(a)
if wrd=72 x1(a)=xn72(a)
if wrd=73 x1(a)=xn73(a)
if wrd=74 x1(a)=xn74(a)
if wrd=75 x1(a)=xn75(a)
if wrd=76 x1(a)=xn76(a)
if wrd=77 x1(a)=xn77(a)
if wrd=78 x1(a)=xn78(a)
if wrd=79 x1(a)=xn79(a)
if wrd=80 x1(a)=xn80(a)
if wrd=81 x1(a)=xn81(a)
if wrd=82 x1(a)=xn82(a)
if wrd=83 x1(a)=xn83(a)
if wrd=84 x1(a)=xn84(a)
if wrd=85 x1(a)=xn85(a)
if wrd=86 x1(a)=xn86(a)
if wrd=87 x1(a)=xn87(a)
if wrd=88 x1(a)=xn88(a)
if wrd=89 x1(a)=xn89(a)
if wrd=90 x1(a)=xn90(a)
if wrd=91 x1(a)=xn91(a)
if wrd=92 x1(a)=xn92(a)
if wrd=93 x1(a)=xn93(a)
if wrd=94 x1(a)=xn94(a)
if wrd=95 x1(a)=xn95(a)
if wrd=96 x1(a)=xn96(a)
if wrd=97 x1(a)=xn97(a)
if wrd=98 x1(a)=xn98(a)
if wrd=99 x1(a)=xn99(a)
if wrd=100 x1(a)=xn100(a)
if wrd=101 x1(a)=xn101(a)
if wrd=102 x1(a)=xn102(a)
if wrd=103 x1(a)=xn103(a)
if wrd=104 x1(a)=xn104(a)
if wrd=105 x1(a)=xn105(a)
if wrd=106 x1(a)=xn106(a)
if wrd=107 x1(a)=xn107(a)
if wrd=108 x1(a)=xn108(a)
if wrd=109 x1(a)=xn109(a)
if wrd=110 x1(a)=xn110(a)
next a

for a=1 to 12
if x(a)>x1(a) x(a)=x(a)-1
if x(a)<x1(a) x(a)=x(a)+1
next a

for a=1 to 12
text x(a),260,xl$(a)
next a

until (1=0)

data "A","C","E","I","L","N","O","P","R","T","W","Y"
data 230,245,260,275,290,305,320,335,350,365,380,395
data 290,230,245,305,335,320,380,365,260,275,395,350
data 335,365,275,230,320,245,380,305,290,260,395,350
data 320,275,290,335,305,350,245,230,260,380,365,395
data 245,365,305,260,335,395,380,320,290,275,230,350
data 245,305,350,260,365,275,320,230,335,290,380,395
data 320,365,275,335,230,350,245,305,290,380,260,395
data 230,365,275,260,245,290,320,305,335,350,380,395
data 380,305,275,320,230,395,245,365,290,335,260,350
data 245,365,275,380,395,335,320,305,290,260,230,350 rem 10
data 320,230,275,380,350,260,245,395,305,290,335,365
data 245,335,350,320,380,275,290,365,260,305,230,395
data 260,320,335,305,245,290,395,230,350,365,380,275
data 320,365,350,380,305,275,245,290,260,335,230,395
data 245,230,335,305,365,260,380,350,290,320,275,395
data 245,395,290,380,230,320,350,365,305,335,260,275
data 335,230,290,380,350,305,245,395,275,320,260,365
data 365,230,260,380,395,320,305,290,245,350,275,335
data 350,245,320,230,365,335,275,305,260,380,290,395
data 350,395,245,365,380,290,275,260,335,320,230,305 rem 20
data 245,395,335,260,365,290,305,350,320,275,230,380
data 335,350,320,365,305,275,245,290,260,380,230,395
data 305,320,335,365,380,275,245,290,260,230,350,395
data 365,320,335,305,395,230,245,275,290,260,380,350
data 305,320,395,365,290,275,245,380,260,230,350,335
data 245,350,335,365,230,275,305,320,290,380,260,395
data 290,350,245,380,395,230,365,275,305,320,260,335
data 245,260,275,305,290,380,350,320,230,335,365,395
data 350,275,320,245,305,260,290,335,365,380,230,395
data 260,230,335,365,350,395,380,320,245,290,275,305 rem 30
data 245,290,335,365,350,380,305,320,260,395,230,275
data 305,275,395,230,335,260,245,380,290,350,320,365
data 305,320,335,245,290,395,365,230,380,260,350,275
data 320,350,305,365,290,275,245,335,260,380,230,395
data 380,350,275,305,365,320,245,395,260,290,230,335
data 305,230,275,245,365,395,380,335,290,260,320,350
data 260,230,395,365,245,380,305,290,320,335,350,275
data 320,230,275,380,260,395,245,290,305,350,365,335
data 245,350,305,380,320,395,365,335,260,275,230,290
data 365,230,335,245,350,395,305,290,320,260,380,275 rem 40
data 245,260,395,365,380,335,305,350,230,290,320,275
data 245,380,275,365,260,320,305,230,350,335,290,395
data 245,320,335,305,365,260,380,350,290,275,230,395
data 230,335,350,320,365,260,380,290,305,395,245,275
data 260,380,395,365,290,320,335,230,245,350,275,305
data 245,380,395,350,305,365,290,230,275,260,335,320
data 350,290,305,275,260,380,245,230,335,320,365,395
data 365,335,395,245,290,260,305,275,350,380,230,320
data 365,230,245,380,395,335,305,290,320,350,260,275
data 365,380,395,275,245,290,335,230,350,305,320,260 rem 50
data 305,350,395,245,380,335,365,230,320,260,290,275
data 305,260,275,245,230,365,380,290,320,335,395,350
data 305,290,275,245,380,365,350,260,320,335,230,395
data 320,350,275,245,365,260,380,335,305,290,230,395
data 260,380,395,365,230,275,245,290,305,335,350,320
data 320,335,350,230,305,365,380,290,260,245,395,275
data 290,350,320,230,365,305,380,395,260,245,335,275
data 245,335,275,320,230,395,380,290,305,260,365,350
data 305,380,395,365,290,260,245,335,350,275,230,320
data 350,260,380,245,395,365,305,335,230,290,320,275 rem 60
data 230,275,380,305,290,245,350,335,395,320,365,260
data 245,275,290,380,305,395,335,230,260,320,365,350
data 260,305,245,380,320,395,335,365,275,350,230,290
data 320,350,275,365,230,335,245,305,290,380,260,395
data 320,365,245,335,350,305,380,230,260,275,395,290
data 245,350,335,380,365,290,305,395,260,320,230,275
data 380,230,335,305,245,320,260,395,365,350,290,275
data 320,350,305,365,290,275,245,335,260,380,230,395
data 350,230,380,290,335,305,245,275,395,320,260,365
data 305,245,350,230,335,365,275,320,260,380,290,395 rem 70
data 305,260,275,245,395,230,365,290,320,335,380,350
data 305,380,395,365,350,260,245,230,320,335,290,275
data 365,380,395,245,350,260,305,335,290,230,320,275
data 305,380,395,350,230,365,245,335,290,275,260,320
data 365,290,275,305,350,395,245,260,230,320,380,335
data 245,350,335,380,365,275,305,395,290,320,260,230
data 320,290,395,365,305,275,245,380,260,230,350,335
data 245,290,395,305,380,275,365,350,260,320,230,335
data 245,260,275,365,380,335,305,230,320,290,350,395
data 305,350,290,380,365,320,260,395,245,275,230,335 rem 80
data 320,230,350,380,335,275,245,305,260,395,365,290
data 320,290,245,365,305,380,395,230,260,275,350,335
data 260,395,365,305,290,335,320,275,245,230,380,350 rem 81
data 305,260,275,365,380,245,230,290,320,335,350,395
data 260,275,290,320,350,335,365,305,245,230,380,395
data 350,335,320,290,230,305,245,275,365,380,260,395
data 260,380,290,365,350,335,305,275,245,230,320,395
data 320,335,290,230,380,275,245,365,305,350,260,395
data 305,320,335,245,260,395,380,290,350,275,230,365
data 380,275,290,260,365,335,320,350,245,230,305,395
data 320,230,395,365,275,350,245,290,305,380,260,335
data 335,350,260,305,380,320,365,230,245,395,290,275
data 320,290,275,245,350,260,305,365,380,335,230,395 rem 91
data 290,230,245,305,350,320,365,335,260,275,380,395
data 350,275,380,245,335,260,290,320,395,305,230,365
data 245,275,290,305,320,380,350,260,365,230,335,395
data 320,350,290,380,365,230,245,305,260,395,275,335
data 380,275,260,245,230,335,305,365,290,395,320,350
data 380,365,260,230,350,275,320,290,305,395,335,245
data 380,290,305,275,395,320,335,365,245,230,350,260
data 260,320,350,305,335,365,380,245,275,290,395,230
data 320,245,365,275,260,380,230,290,350,395,305,335
data 290,335,275,245,305,260,365,320,350,230,380,395
data 350,230,335,320,365,290,260,380,245,305,275,395
data 365,260,305,290,275,320,245,395,380,335,350,230
data 320,350,260,230,305,275,380,395,365,290,245,335
data 290,275,350,245,335,365,260,320,230,380,305,395
data 305,290,275,245,230,320,380,350,365,260,395,335
data 335,350,305,245,260,320,380,290,395,365,230,275
data 260,365,335,380,395,350,230,320,275,290,245,305
data 335,275,290,245,395,260,380,320,365,350,230,305
data 290,245,335,230,395,305,380,320,365,350,275,260


11
Yabasic / Display Helper
« on: June 01, 2025 »
There a grid display operated by a phone app.
to display preset pictures.
I wrote my own picture maker.
D-pad to move high-lighted square.
Page up/down to change the colour.
The numbers show how much of each colour.
'END' to randomize.

Code: [Select]
restore rainbow
read hue
dim R(hue)
dim G(hue)
dim B(hue)
dim C$(hue)

for a=1 to hue
read R(a)
read G(a)
read B(a)
read C$(a)
next a

tiles=256
dim col(tiles)
dim tot(tiles)

for a=1 to tiles
col(a)=int(ran(hue))+1
next a

sel=1

dim go(16)
dim g(16)

open window 640,512
repeat
setdrawbuf vm
vm=1-vm
setdispbuf vm
clear window

c=peek("port1")

for a=1 to 16
if and(c,2^(a-1))<>0 go(a)=1
if go(a)=1 g(a)=g(a)+1
if g(a)>2 g(a)=2
if g(a)=2 go(a)=0
if and(c,2^(a-1))=0 g(a)=0
next a

if go(8)=1 sel=sel-1
if go(6)=1 sel=sel+1
if go(5)=1 sel=sel-1
if go(7)=1 sel=sel+16
if sel>81 sel=sel-256
if sel<1 sel=sel+256
if sel<1 sel=1
if sel>tiles sel=tiles

for a=1 to tiles
if go(14)=1 col(a)=int(ran(hue))+1
next a

for a=1 to tiles
if sel=a and go(1)=1 col(a)=col(a)-1
if sel=a and go(4)=1 col(a)=col(a)+1
if col(a)<0 col(a)=0
if col(a)>hue  col(a)=hue
next a

for a=1 to hue
tot(a)=0
next a

for a=1 to tiles
for b=1 to hue
if col(a)=b tot(b)=tot(b)+1
next b
next a

for a=1 to hue
text 540,a*20+8,str$(tot(a),"##")
total=total+tot(a)
next a

w=0
h=0
for a=1 to tiles
w=w+1
if w>16 then
w=1
h=h+1
endif
for b=1 to hue
if col(a)=b setrgb 1,R(b),G(b),B(b)
next b
fill rectangle w*20+122,42+(h*20) to w*20+142,62+(h*20)
next a

w=0
h=0
for a=1 to tiles
w=w+1
if w>16 then
w=1
h=h+1
endif

setrgb 1,256,256,256
if sel=a rectangle w*20+122,42+(h*20) to w*20+142,62+(h*20)

next a

for a=1 to hue
setrgb 1,R(a),G(a),B(a)
fill rectangle 570,a*20-5 to 590,a*20+15
'setrgb 1,256,256,256
'text 570,a*20+10,C$(a)
next a

setrgb 1,256,256,256
for a=1 to tiles
for b=1 to hue
if sel=a and col(a)=b rectangle 570,b*20-5 to 590,b*20+15
next b
next a

until (1=0)

label rainbow
data 24
data 256,000,000,"red"
data 256,104,030,"orange"
data 256,256,000,"yellow"
data 000,256,000,"green"
data 000,000,256,"blue"
data 080,100,200,"indigo"
data 050,010,060,"violet"
data 120,060,000,"brown"
data 128,128,128,"grey"
data 256,150,150,"pink"
data 256,200,160,"flesh"
data 256,256,256,"white"
data 220,020,060,"crimson"
data 144,000,032,"burgundy"
data 204,119,034,"ochre"
data 128,128,000,"olive"
data 128,000,000,"maroon"
data 128,055,144,"l.violet"
data 242,133,000,"tangerine"
data 180,090,000,"tan"
data 128,000,000,"d.green"
data 000,128,128,"sky blue"
data 102,000,153,"purple"
data 000,128,000,"d.green"


12
Yabasic / Puzzle Helper
« on: June 01, 2025 »
This saves with writing all the letters
of a puzzle where the letter is replaced
by a number. The bottom left number
is for the high-lighted square.
D-pad to move the square.
Stop the program to insert a guess.
(This is already played-blank to play. I have more I've played.)

Code: [Select]
read cross
dim num(cross)
for a=1 to cross
read num(a)
next a
sq=9

read worm
dim digit(worm)
for a=1 to worm
read digit(a)
next a

read caps
dim cnt(caps)
dim ltr$(caps)
dim set(caps)
for a=1 to caps
read ltr$(a)
read set(a)
next a

sel=1
number=1
grid=1

open window 640,512
repeat
setdrawbuf vm
vm=1-vm
setdispbuf vm
clear window
setrgb 1,256,256,256
fill rectangle 0,0 to 640,512
c=peek("port1")

if c=128 sel=sel-1
if c=32 sel=sel+1

if c=16 sel=sel-35
if c=64 sel=sel+35

if sel<1 sel=sel+875
if sel>875 sel=sel-875

if c=8 number=number+1
if number>26 number=1

if and(c,1024)<>0 ctrl=1
if ctrl=1 CT=CT+1
if CT>2 CT=2
if CT=2 ctrl=0
if and(c,1024)=0 CT=0

if and(c,8192)<>0 send=1
if send=1 E=E+1
if E>2 E=2
if E=2 send=0
if and(c,8192)=0 E=0

if ctrl=1 grid=grid+1
if grid>24 grid=1

x=0
y=0
x1=0
y1=0
x2=0
y2=0
x3=0
y3=0

setrgb 1,0,0,0
rectangle 1,1 to 639,511

for h=1 to 26
line 5,h*18+13 to 635,h*18+13
next h

for v=1 to 36
line v*18-13,30 to v*18-13,480
next v

for a=1 to cross
if send=1 num(a)=int(ran(27))
next a

if grid=1 restore gridone

read cross
dim num(cross)
dim cnt(cross)

for a=1 to cross
read num(a)
next a

for a=1 to cross
cnt(a)=0
next a

for a=1 to cross
for b=1 to caps
if num(a)=b cnt(b)=cnt(b)+1
next b
next a

for a=1 to cross
text a*23+20,25,str$(cnt(a))
next a

for a=1 to caps
text a*23+20,12,str$(set(a))
next a

if grid=1 restore gridlineone

read worm
dim digit(worm)

for a=1 to worm
read digit(a)
next a

if grid=1 restore letterone

read caps
dim ltr$(caps)
dim set(caps)

for a=1 to caps
read ltr$(a)
read set(a)
next a

text 0,12,"grid"
text 20,25,str$(grid)

for a=1 to cross
x=x+1
if num(a)=00 fill rectangle x*18-4-sq,y*18+40-sq to x*18-4+sq,y*18+40+sq
if x>34 then
y=y+1
x=0
endif
next a

for a=1 to cross
x2=x2+1
if sel=a then
text 5,500,str$(num(a))
setrgb 1,256,128,0
fill rectangle x2*18-5-(sq-1),y2*18+39-(sq-1) to x2*18-4+(sq-1),y2*18+40+(sq-1)
endif
if x2>34 then
y2=y2+1
x2=0
endif
next a

for a=1 to cross
x3=x3+1
if num(a)=number then
setrgb 1,256,256,0
fill rectangle x3*18-4-sq,y3*18+40-sq to x3*18-5+sq,y3*18+39+sq
endif
if x3>34 then
y3=y3+1
x3=0
endif
next a

setrgb 1,0,0,0

for a=1 to cross
x1=x1+1
for b=1 to caps
if num(a)=b text x1*18-sq,y1*18+51-sq,ltr$(b)
if x1>35 then
y1=y1+1
x1=1
endif
next b
next a

for a=1 to worm
for b=1 to caps
if digit(a)=b text 18*a+160,500,ltr$(b)
next b
next a

for a=1 to worm
line 18*a+160,504 to 18*a+170,504
next a

until (1=0)

label gridone
data 875
data 25,16,06,22,08,00,06,22,08,24,00,12,19,22,19,12,05,00,18,19,04,14,20,24,00,16,19,20,14,00,16,22,11,21,20
data 00,00,08,00,21,08,08,00,05,19,24,05,00,00,08,16,07,14,05,22,05,00,00,04,16,08,24,00,21,16,08,00,06,00,00
data 19,00,09,05,04,05,21,02,05,22,00,08,05,24,20,03,05,00,24,05,03,03,05,22,00,24,15,19,20,06,03,19,24,00,19
data 15,22,16,20,05,04,20,00,09,21,04,05,00,03,05,09,00,22,00,19,03,05,00,05,13,05,24,00,24,04,18,20,14,05,24
data 05,00,00,14,00,13,00,18,00,24,16,22,22,18,00,00,04,06,11,00,00,20,22,19,21,20,00,19,00,14,00,03,00,00,13
data 00,24,20,21,22,00,03,19,12,00,20,21,05,00,15,22,05,09,21,04,20,00,21,25,15,00,10,21,20,00,02,19,08,05,00
data 04,00,05,04,16,08,16,25,21,04,00,04,19,12,05,00,08,05,05,00,05,11,11,24,00,20,05,03,05,02,21,24,05,00,21
data 05,22,05,00,09,21,12,00,22,19,12,00,25,05,22,21,20,00,22,16,15,05,24,00,08,05,07,00,19,21,25,00,22,05,09
data 09,19,25,08,00,20,00,19,03,20,16,24,00,20,21,04,00,22,00,07,05,05,00,10,21,08,05,09,00,19,00,16,02,19,03
data 05,08,24,06,05,00,14,21,24,00,08,19,11,00,03,16,02,19,11,03,05,00,08,06,08,00,22,19,15,00,05,02,05,22,18
data 00,12,00,09,05,20,05,22,00,10,05,20,05,09,00,08,00,24,00,24,00,10,16,22,20,05,00,11,19,24,20,05,00,08,00
data 25,05,20,05,22,00,21,00,24,21,22,00,08,21,15,00,19,15,20,00,24,16,09,00,14,19,12,00,20,00,04,22,19,24,14
data 06,00,16,00,21,08,10,03,06,17,00,03,05,12,21,16,08,00,19,11,19,04,06,24,00,24,05,19,22,04,14,00,24,00,06
data 25,19,15,03,05,00,05,00,15,05,22,00,10,21,12,00,18,05,08,00,15,19,03,00,14,05,25,00,21,00,21,24,24,06,05
data 00,25,00,06,24,06,22,15,00,09,05,11,21,20,00,24,00,18,00,24,00,03,05,02,05,03,00,01,16,21,08,20,00,08,00
data 11,05,19,24,20,00,24,06,11,00,03,21,20,00,10,16,22,05,24,20,24,00,24,05,19,00,03,16,20,00,12,19,10,10,05
data 21,08,04,14,00,07,00,08,16,25,19,09,00,08,19,18,00,09,00,16,19,10,00,20,22,16,06,20,00,15,00,22,05,05,09
data 19,09,16,00,24,19,09,00,22,19,18,00,03,21,03,19,04,00,24,15,03,21,20,00,20,19,22,00,08,16,22,00,19,09,09
data 24,00,22,05,19,24,16,08,05,09,00,22,16,11,24,00,22,19,20,00,19,11,06,20,00,22,05,25,16,20,05,24,20,00,18
data 00,24,08,19,12,00,12,16,09,00,24,19,04,00,05,25,05,22,19,03,09,00,04,19,15,00,09,16,20,00,15,19,24,24,00
data 19,00,00,12,00,25,00,07,00,10,21,24,14,18,00,00,07,21,12,00,00,24,13,21,05,09,00,11,00,14,00,11,00,00,05
data 12,22,21,03,03,05,09,00,23,21,08,04,00,05,03,10,00,09,00,25,16,15,00,03,19,21,09,00,24,19,21,03,21,08,12
data 16,00,20,05,05,08,19,12,05,22,00,19,04,20,16,22,24,00,20,16,25,19,20,16,00,08,06,22,20,06,22,05,09,00,16
data 00,00,04,00,24,06,25,00,22,05,19,03,00,00,22,16,06,20,21,08,05,00,00,22,05,05,13,00,05,03,13,00,05,00,00
data 19,24,14,05,24,00,24,14,16,09,00,24,16,03,05,25,08,00,15,16,08,21,05,24,00,09,05,05,15,00,24,04,19,22,18

label gridlineone
data 17
data 15,19,20,22,21,04,21,19,00,04,03,19,22,13,24,16,08

label letterone
data 26
data "J",01
data "V",02
data "L",03
data "C",04
data "E",05
data "U",06
data "W",07 rem start letter
data "N",08
data "D",09
data "F",10
data "B",11
data "G",12
data "K",13 rem start letter
data "H",14
data "P",15
data "O",16
data "X",17
data "Y",18
data "A",19
data "T",20
data "I",21
data "R",22
data "Z",23
data "S",24
data "M",25
data "Q",26 rem unused


13
Yabasic / String Inserting.
« on: May 31, 2025 »
D-pad to choose and change.
Or 'END' for random.

Code: [Select]
restore names
read title
dim noun$(title)
dim name$(title)
for a=1 to title
read noun$(a)
read name$(a)
next a

restore pain
read level
dim con$(level)
dim hurt$(level)
for a=1 to level
read con$(a)
read hurt$(a)
next a

restore body
read part
dim human$(part)
for a=1 to part
read human$(a)
next a

restore keys
read button
dim key$(button)
dim ctrl$(button)
for a=1 to button
read key$(a)
read ctrl$(a)
next a

restore friends
read past
dim names$(past)
dim surnames$(past)
for a=1 to past
read names$(a)
read surnames$(a)
next a

dim g(16)
dim go(16)

wrd=1
sel1=1
sel2=1
sel3=1
off=1
com=1

open window 640,512
repeat
setdispbuf vm
vm=1-vm
setdrawbuf vm
clear window
c=peek("port1")

for a=1 to 16
if and(c,2^(a-1))<>0 go(a)=1
if go(a)=1 g(a)=g(a)+1
if g(a)>2 g(a)=2
if g(a)=2 go(a)=0
if and(c,2^(a-1))=0 g(a)=0
next a

if go(4)=1 com=com+1
if com>2 com=1

if go(11)=1 off=off+1
if off>2 off=1

for a=1 to 16
if off=2 text 480,a*12+12,str$(a,"##")+" "+str$(2^(a-1))
next a

for a=1 to button
if off=2 and com=1 text 470-len(key$(a))*10,a*12+12,key$(a)
if off=2 and com=2 text 470-len(ctrl$(a))*10,a*12+12,ctrl$(a)
next a

if off=2 then
setrgb 1,256,256,256
text 00,260,"sentence "+str$(len(medical$))
text 40,275,"name "+str$(len(name$),"##")
text 40,290,"pain "+str$(len(hurt$),"##")
text 40,305,"body "+str$(len(human$),"##")
endif

if off=2 text 500,268,"past friends"

if off=2 then
text 500,280,"("+str$(past)+")"
for a=1 to past
text 530-len(names$(a))*10,a*12+280,names$(a)+" "+surnames$(a)
next a
endif

if go(8)=1 wrd=wrd-1
if go(6)=1 wrd=wrd+1
if wrd<1 wrd=1
if wrd>3 wrd=3

if off=1 then
if wrd=1 hilite=1
if wrd=2 hilite=4
if wrd=3 hilite=8
endif

if off=1 then

if wrd=1 and go(5)=1 sel1=sel1-1
if wrd=1 and go(7)=1 sel1=sel1+1
if sel1<1 sel1=1
if sel1>title sel1=title

if wrd=2 and go(5)=1 sel2=sel2-1
if wrd=2 and go(7)=1 sel2=sel2+1
if sel2<1 sel2=1
if sel2>level sel2=level

if wrd=3 and go(5)=1 sel3=sel3-1
if wrd=3 and go(7)=1 sel3=sel3+1
if sel3<1 sel3=1
if sel3>part sel3=part

endif

for a=1 to title
if sel1=a name$=name$(a)
if sel1=a and off=2 text 90,150,str$(a,"##")+" of "+str$(title)
if sel1=a and noun$(a)="m" noun$="his"
if sel1=a and noun$(a)="f" noun$="her"
next a

for a=1 to level
if sel2=a hurt$=hurt$(a)
if sel2=a and off=2 text 90,165,str$(a,"##")+" of "+str$(level)
if sel2=a and con$(a)="s" con$="a"
if sel2=a and con$(a)="p" con$="an"
next a

for a=1 to part
if sel3=a human$=human$(a)
if sel3=a and off=2 text 90,180,str$(a,"##")+" of "+str$(part)
next a

if go(14)=1 then
sel1=int(ran(title))+1
sel2=int(ran(level))+1
sel3=int(ran(part))+1
endif

'if go(1)=1 hilite=hilite+1
'if hilite>8 hilite=1
'if go(4)=1 hilite=int(ran(8))+1

medical$=" "+name$+" has "+con$+" "+hurt$+" pain in "+noun$+" "+human$

gap=0
for a=1 to len(medical$)
if mid$(medical$,a,1)=" " gap=gap+1

if hilite=gap and off=1 then
setrgb 1,0,256,0
else
setrgb 1,256,256,256
endif

text a*10+10,240,mid$(medical$,a,1)
next a

until (1=0)

label names
data 100
data "m","vance"
data "f","ruth"
data "m","paul"
data "f","rachael"
data "f","marilyn"
data "m","patrick"
data "m","kelly"
data "f","penny"
data "m","brian"
data "m","chris"
data "f","caroline"
data "f","joanne"
data "f","sarah"
data "m","pender"
data "m","dennis"
data "f","iris"
data "m","mark"
data "f","shannon"
data "f","debbie"
data "f","estelle"
data "f","joanne"
data "m","jason"
data "m","nick"
data "f","linda"
data "m","fred"
data "m","chris"
data "m","daryl"
data "m","thom"
data "m","raymond"
data "f","joanne"
data "m","alex"
data "m","graham"
data "f","christine"
data "f","marion"
data "f","helene"
data "f","diane"
data "f","annette"
data "m","don"
data "m","john"
data "m","anthony"
data "m","geoffrey"
data "f","jaya"
data "f","lynette"
data "f","jessica"
data "m","jason"
data "f","raera"
data "f","melanie"
data "f","melody"
data "f","carmen"
data "f","ida"
data "m","rough guy"
data "m","greek guy"
data "m","chris"
data "m","arthur"
data "m","ian"
data "m","a.k."
data "m","bruce"
data "m","peter"
data "m","nigel"
data "m","manwell"
data "m","andy"
data "f","sarah"
data "f","karen"
data "m","darryl"
data "f","ethel"
data "f","moana"
data "m","martyn"
data "m","sandy"
data "m","twink"
data "m","patrick"
data "m","peter"
data "m","jamie"
data "m","robert"
data "m","richard"
data "f","janice"
data "m","lance"
data "m","nigel"
data "m","ben"
data "m","lyall"
data "m","david"
data "f","chrissy"
data "m","kevin"
data "m","roger"
data "m","kerri"
data "m","eric"
data "m","pray guy"
data "m","darian"
data "m","graeme"
data "m","jeremy"
data "m","jim"
data "m","pete"
data "m","sean"
data "m","peter"
data "m","dave"
data "m","mark"
data "m","ashwad"
data "m","sarne"
data "f","andrea"
data "f","erika"
data "m","angelo"

label pain
data 51
data "s","sharp"
data "p","undetectable"
data "s","minor"
data "p","insignificant"
data "s","worrisome"
data "p","acute"
data "s","moderate"
data "p","important"
data "s","troublesome"
data "p","important"
data "s","throbbing"
data "p","undesirable"
data "s","grave"
data "p","untreated"
data "s","painful"
data "p","increasing"
data "s","terrible"
data "p","unsufferable"
data "s","dangerous"
data "p","irritating"
data "s","worrying"
data "p","inflamed"
data "s","major"
data "p","unsightly"
data "s","life-threatening"
data "p","incredible"
data "s","stinging"
data "p","itchy"
data "s","bearable"
data "p","ongoing"
data "s","piercing"
data "p","odd"
data "s","grim"
data "p","extruciating"
data "s","sensitive"
data "p","unsafe"
data "s","critical"
data "p","alarming"
data "s","significant"
data "p","unpleasant"
data "s","severe"
data "p","annoying"
data "s","serious"
data "p","aggrevating"
data "s","stabbing"
data "p","awful"
data "s","dull"
data "p","intense"
data "s","dire"
data "p","unbearable"
data "s","delicate"

label body
data 36
data "head"
data "eyes"
data "ears"
data "cheeks"
data "mouth"
data "nose"
data "neck"
data "shoulders"
data "back"
data "ribs"
data "torso"
data "left-arm"
data "right-arm"
data "left-hand"
data "right-hand"
data "upperarms"
data "forearms"
data "elbows"
data "hands"
data "wrists"
data "fingers"
data "chest"
data "waist"
data "hip"
data "buttocks"
data "ass"
data "left-leg"
data "right-leg"
data "thighs"
data "knees"
data "shins"
data "ankles"
data "left-foot"
data "right-foot"
data "feet"
data "toes"

label keys
data 16
data "page up","select"
data "F1","L3"
data "F2","R3"
data "page down","start"
data "up arrow","up"
data "right arrow","right"
data "down arrow","down"
data "left arrow","left"
data "menu","L2"
data "tab","R2"
data "control","L1"
data "capitals","R1"
data "home","triangle"
data "end","circle"
data "delete","cross"
data "insert","square"

label friends
data 19
data "david","teleai"
data "joanna","teleai"
data "tobey","hall"
data "nicola","hall"
data "lego","electronic"
data "mark","norris"
data "terry","flowers"
data "shane","brown"
data "victor","sutherland"
data "rodney","elmes"
data "gary","muddle"
data "dale","swift"
data "jan","morrison"
data "richard","deslauriers"
data "patrick","cadogen"
data "bernadette","cadogen"
data "martyn","salisbury"
data "mark","maloney"
data "vicky","?"
data "roger","rush"


14
Yabasic / Pinball
« on: May 31, 2025 »
with colour change.

Code: [Select]
ang1=pi/180
ang2=180/pi
ra=30

restore colours
read shade
dim R(shade)
dim G(shade)
dim B(shade)

for a=1 to shade
read R(a)
read G(a)
read B(a)
next a

restore spheres
read ball

dim dirs(ball)
dim xs(ball)
dim ys(ball)
dim ssp(ball)
dim hitang(ball)
dim hit(ball)
dim reang(ball)
dim ra(ball)
dim go(ball)
dim lit(ball)

for a=1 to ball
dirs(a)=0
read xs(a),ys(a)
ssp(a)=0
ra(a)=40
go(a)=int(ran(12))+1
next a

dirm=25
xm=500
ym=100
msp=8
ra=10
'm=.1

open window 640,512
repeat
setdispbuf vm
vm=1-vm
setdrawbuf vm
clear window

setrgb 1,200,200,0
fill rectangle 0,0 to 640,512

for a=1 to ball
xs(a)=xs(a)+cos(dirs(a)*ang1)*ssp(a)
ys(a)=ys(a)+sin(dirs(a)*ang1)*ssp(a)

hitang(a)=atan(xs(a)-xm,ym-ys(a))*ang2+180
hit(a)=(abs(xs(a)-xm)^2+abs(ys(a)-ym)^2)^0.5
reang(a)=((dirs(a)+180)-dirm)*2+dirm-180
if hit(a)<ra(a)+ra dirm=reang(a)
dirs(a)=hitang(a)-90

if hit(a)<ra(a)+ra go(a)=go(a)+1
if go(a)>12 go(a)=1

if hit(a)<ra(a)+ra lit(a)=lit(a)+1
if hit(a)<ra(a)+ra tot=tot+1

for b=1 to shade
if go(a)=b setrgb 1,R(b),G(b),B(b)
next b

'ys(10)=ys(10)-m
'if ys(10)<200 or ys(10)>462 m=-m

fill circle xs(a),ys(a),ra(a)

setrgb 1,0,0,0
circle xs(a),ys(a),ra(a)

setrgb 1,0,0,0
text xs(a)-10,ys(a)+5,str$(lit(a))

next a

xm=xm+cos(dirm*ang1)*msp
ym=ym+sin(dirm*ang1)*msp

setrgb 1,250,120,0
fill circle xm,ym,ra

setrgb 1,0,0,0
circle xm,ym,ra
text 300,250,str$(tot)

if xm<0+ra dirm=270-dirm+270
if xm>640-ra dirm=90-dirm+90
if ym<0+ra dirm=-dirm
if ym>510-ra dirm=180-dirm+180
if dirm>360 dirm=dirm-360
if dirm<0 dirm=dirm+360

until (1=0)

label spheres
data 10
data 252,126
data 396,126
data 468,252
data 396,378
data 252,378
data 180,252
data 50,50
data 590,50
data 50,462
data 590,462

label colours
data 12
data 256,000,000
data 000,256,000
data 000,000,256
data 256,256,000
data 256,128,000
data 256,000,256
data 128,128,128
data 220,020,060
data 256,192,203
data 256,203,164
data 118,215,234
data 150,075,000


15
Yabasic / Mouse Controller
« on: May 31, 2025 »
The program opens all the yabasic keys (5 are used)
for easy operation, momentary and continuous.
D-pad to move the mouse. Delete to hold and release.

Code: [Select]
open window 640,512

restore word
read wrd
dim ltr$(wrd)
for a=1 to wrd
read ltr$(a)
next a

dim xb(10)
dim yb(10)
for a=1 to 10
xb(a)=a*60-40
yb(a)=100
next a

x=320
y=255

keys=16
dim go(keys)
dim g(keys)

key=16
dim go1(key)

off=1
blox=1

repeat
setdrawbuf vm
vm=1-vm
setdispbuf vm
clear window
c=peek("port1")

for a=1 to keys
if and(c,2^(a-1))<>0 go(a)=1
if go(a)=1 g(a)=g(a)+1
if g(a)>2 g(a)=2
if g(a)=2 go(a)=0
if and(c,2^(a-1))=0 g(a)=0
next a

for a=1 to key
if and(c,2^(a-1))<>0 go1(a)=1
if and(c,2^(a-1))=0 go1(a)=0
next a

if go(15)=1 off=off+1
if off>2 off=1

if go(4)=1 blox=blox+1
if blox>10 blox=1

setrgb 1,256,256,256
line x,y to x+10,y
line x,y to x+15,y+15
line x,y to x,y+10

if x<0 x=640
if x>640 x=0
if y<0 y=510
if y>510 y=0

for a=1 to 10
rectangle xb(a),yb(a) to xb(a)+50,yb(a)+50
text xb(a)+20,yb(a)+30,ltr$(a)
next a

if go1(8)=1 x=x-1
if go1(6)=1 x=x+1
if go1(5)=1 y=y-1
if go1(7)=1 y=y+1

if off=2 then
for a=1 to 10
if x>xb(a) and x<xb(a)+50 and y>yb(a) and y<yb(a)+50 then
if go1(6)=1 xb(a)=xb(a)+1
if go1(8)=1 xb(a)=xb(a)-1
if go1(7)=1 yb(a)=yb(a)+1
if go1(5)=1 yb(a)=yb(a)-1
endif
next a
endif

if off=2 then
for a=1 to 10
if x>xb(a) and x<xb(a)+50 and y>yb(a) and y<yb(a)+50 then
setrgb 1,0,256,0
rectangle xb(a),yb(a) to xb(a)+50,yb(a)+50
endif
next a
endif


until (1=0)

label word
data 10
data "S"
data "H"
data "R"
data "I"
data "N"
data "K"
data "A"
data "B"
data "L"
data "E"


16
Yabasic / Region Map
« on: May 31, 2025 »
I did a state bordering map of USA.
use d-pad to navigate.

Code: [Select]
restore states
read area
dim star$(area)
dim capi$(area)
dim abbr$(area)

for a=1 to area
read star$(a)
read capi$(a)
read abbr$(a)
next a

restore america
read map
dim x1s(map),y1s(map),x1f(map),y1f(map)

for a=1 to map
read x1s(a),y1s(a),x1f(a),y1f(a)
next a

restore abbre
read code
dim post$(code)

for a=1 to code
read post$(a)
next a

restore head
read time
dim heading$(time)

for a=1 to time
read heading$(a)
next a


open window 640,512

dim go(16)
dim g(16)

cel=1
st=1
p1=1
p2=1
p3=1
p4=1
p5=1
p6=1
p7=1
p8=1
p9=1
p10=1

capital=1

repeat
setdispbuf vm
vm=1-vm
setdrawbuf vm
clear window

row=0
col=0

c=peek("port1")

for a=1 to 16
if and(c,2^(a-1))<>0 go(a)=1
if go(a)=1 g(a)=g(a)+1
if g(a)>2 g(a)=2
if g(a)=2 go(a)=0
if and(c,2^(a-1))=0 g(a)=0
next a

setrgb 1,256,256,256
for a=1 to map
line x1s(a),y1s(a)-35 to x1f(a),y1f(a)-35
next a

if go(11)=1 cel=cel+1
if cel>12 cel=1

for a=1 to time
if cel=a text 140,280,heading$(a)
next a

text 100,280,str$(st)

if cel=1 then
if go(7)=1 st=st+1
if go(5)=1 st=st-1
if go(6)=1 st=st+13
if go(8)=1 st=st-13

if st>52 st=st-52
if st<1  st=st+52
endif

if cel=2 and go(6)=1 st=int(ran(52))+1

if cel=3 then
if go(7)=1 p1=p1+1
if p1>4 p1=1
if p1=1 st=47
if p1=2 st=37
if p1=3 st=28
if p1=4 st=5
endif

if cel=4 then
if go(7)=1 p2=p2+1
if p2>3 p2=1
if p2=1 st=12
if p2=2 st=44
if p2=3 st=3
endif

if cel=5 then
if go(7)=1 p3=p3+1
if p3>4 p3=1
if p3=1 st=26
if p3=2 st=50
if p3=3 st=6
if p3=4 st=31
endif

if cel=6 then
if go(7)=1 p4=p4+1
if p4>6 p4=1
if p4=1 st=34
if p4=2 st=41
if p4=3 st=27
if p4=4 st=16
if p4=5 st=36
if p4=6 st=43
endif

if cel=7 then
if go(7)=1 p5=p5+1
if p5>5 p5=1
if p5=1 st=23
if p5=2 st=15
if p5=3 st=25
if p5=4 st=4
if p5=5 st=18
endif

if cel=8 then
if go(7)=1 p6=p6+1
if p6>4 p6=1
if p6=1 st=22
if p6=2 st=49
if p6=3 st=13
if p6=4 st=24
endif

if cel=9 then
if go(7)=1 p7=p7+1
if p7>5 p7=1
if p7=1 st=22
if p7=2 st=14
if p7=3 st=17
if p7=4 st=42
if p7=5 st=1
endif

if cel=10 then
if go(7)=1 p8=p8+1
if p8>3 p8=1
if p8=1 st=35
if p8=2 st=10
if p8=3 st=9
endif

if cel=11 then
if go(7)=1 p9=p9+1
if p9>7 p9=1
if p9=1 st=32
if p9=2 st=38
if p9=3 st=20
if p9=4 st=48
if p9=5 st=46
if p9=6 st=33
if p9=7 st=40
endif

if cel=12 then
if go(7)=1 p10=p10+1
if p10>8 p10=1
if p10=1 st=19
if p10=2 st=29
if p10=3 st=45
if p10=4 st=21
if p10=5 st=39
if p10=6 st=7
if p10=7 st=30
if p10=8 st=8
endif

for a=1 to code
if st=a text 10,15,post$(a)
next a

if st=1 restore al_
if st=2 restore ak_
if st=3 restore az_
if st=4 restore ar_
if st=5 restore ca_
if st=6 restore co_
if st=7 restore ct_
if st=8 restore de_
if st=9 restore fl_
if st=10 restore ga_
if st=11 restore hi_
if st=12 restore id_
if st=13 restore il_
if st=14 restore in_
if st=15 restore ia_
if st=16 restore ks_
if st=17 restore ky_
if st=18 restore la_
if st=19 restore me_
if st=20 restore md_
if st=21 restore ma_
if st=22 restore mi_
if st=23 restore mn_
if st=24 restore ms_
if st=25 restore mo_
if st=26 restore mt_
if st=27 restore ne_
if st=28 restore nv_
if st=29 restore nh_
if st=30 restore nj_
if st=31 restore nm_
if st=32 restore ny_
if st=33 restore nc_
if st=34 restore nd_
if st=35 restore oh_
if st=36 restore ok_
if st=37 restore or_
if st=38 restore pa_
if st=39 restore ri_
if st=40 restore sc_
if st=41 restore sd_
if st=42 restore tn_
if st=43 restore tx_
if st=44 restore ut_
if st=45 restore vt_
if st=46 restore va_
if st=47 restore wa_
if st=48 restore wv_
if st=49 restore wi_
if st=50 restore wy_
if st=51 restore vc_
if st=52 restore cm_

read state
dim xs(state),ys(state),xf(state),yf(state)

for a=1 to state
read xs(a),ys(a),xf(a),yf(a)
next a

for a=1 to state
setrgb 1,256,96,32
line xs(a),ys(a)-35 to xf(a),yf(a)-35
next a

for a=1 to area
row=row+1
if row>13 then
col=col+150
row=1
endif
if a=st then
setrgb 1,0,256,0
else
setrgb 1,256,256,256
endif
if st<51 text col+20,row*15+310,star$(a)
if st=51 text col+20,row*15+310,capi$(a)
if st=52 text col+20,row*15+310,abbr$(a)
next a

until (1=0)

label head
data 12
data "list"
data "random"
data "time zone 1"
data "time zone 2"
data "time zone 3"
data "time zone 4"
data "time zone 5"
data "time zone 6"
data "time zone 7"
data "time zone 8"
data "time zone 9"
data "time zone 10"

label abbre
data 52
data "al_","ak_","az_","ar_","ca_","co_","ct_","de_","fl_","ga_","hi_","id_","il_"
data "in_","la_","ks_","ky_","la_","me_","md_","ma_","mi_","mn_","ms_","mo_","mt_"
data "ne_","nv_","nh_","nj_","nm_","ny_","nc_","nd_","oh_","ok_","or_","pa_","ri_"
data "sc_","sd_","tn_","tx_","ut_","vt_","va_","wa_","wv_","wi_","wy_","vc_","cm_"

label states
data 52
data "Alabama","Montgomer","AL"
data "Alaska","Juneau","AK"
data "Arizona","Phoenix","AZ"
data "Arkansas","Little Rock","AR"
data "California","Sacramento","CA"
data "Colorado","Denver","CO"
data "Connecticut","Hartford","CT"
data "Delaware","Dover","DE"
data "Florida","Tallahassee","FL"
data "Georgia","Atlanta","GA"
data "Hawaii","Honolulu","HI"
data "Idaho","Boise","ID"
data "Illinois","Springfield","IL"
data "Indiana","Indianapolis","IN"
data "Iowa","Des Moines","IA"
data "Kansas","Topeka","KS"
data "Kentucky","Frankfort","KY"
data "Louisiana","Baton Rouge","LA"
data "Maine","Augusta","ME"
data "Maryland","Annapolis","MD"
data "Massachusetts","Boston","MA"
data "Michigan","Lansing","MI"
data "Minnesota","Saint Paul","MN"
data "Mississippi","Jackson","MS"
data "Missouri","Jefferson City","MO"
data "Montana","Helena","MT"
data "Nebraska","Lincoln","NE"
data "Nevada","Carson City","NV"
data "New Hampshire","Concord","NH"
data "New Jersey","Trenton","NJ"
data "New Mexico","Santa Fe","NM"
data "New York","Albany","NY"
data "North Carolina","Raleigh","NC"
data "North Dakota","Bismarck","ND"
data "Ohio","Columbus","OH"
data "Oklahoma","Oklahoma City","OK"
data "Oregon","Salem","OR"
data "Pennsylvania","Harrisburg","PA"
data "Rhode Island","Providence","RI"
data "South Carolina","Columbia","SC"
data "South Dakota","Pierre","SD"
data "Tennesse","Nashville","TN"
data "Texas","Austin","TX"
data "Utah","Salt Lake City","UT"
data "Vermont","Montpelier","VT"
data "Virginia","Richmond","VA"
data "Washington","Olympia","WA"
data "West Virginia","Charleston","WV"
data "Wisconsin","Madison","WI"
data "Wyoming","Cheyenne","WY"
data "state capitals","showing capitals",""
data "state codes","","showing codes"

label america
data 395
'alabama
data 422,252,422,310
data 422,310,432,310
data 432,310,432,304
data 432,304,463,301
data 463,301,462,281
data 462,281,448,250
data 448,250,422,252
'alaska
data 015,075,015,060
data 030,060,015,060
data 040,085,015,060
'arizona
data 124,210,122,219
data 122,219,117,219
data 117,219,113,234
data 113,234,104,260
data 104,260,146,285
data 146,285,179,287
data 179,285,185,216
data 185,216,124,210
'arkansas
data 345,235,345,267
data 345,267,352,273
data 352,273,352,279
data 352,279,388,279
data 388,279,388,270
data 388,270,394,252
data 394,252,399,244
data 399,244,395,235
data 395,235,345,235
'california
data 039,124,031,164
data 031,164,048,223
data 048,223,081,258
data 081,258,104,260
data 104,260,113,234
data 113,234,117,218
data 117,218,068,170
data 068,170,077,133
data 077,133,039,124
'colorado
data 190,167,185,216
data 185,216,251,224
data 251,224,264,225
data 264,225,265,187
data 265,187,265,174
data 265,174,243,172
data 243,172,190,167
'connecticut
data 567,146,568,158
data 568,158,579,152
data 579,152,576,144
data 576,144,567,146
'delaware
data 546,178,543,185
data 543,185,547,194
data 547,194,558,201
data 558,201,560,190
data 560,190,546,178
'florida
data 432,304,432,310
data 432,310,449,310
data 449,310,462,317
data 462,317,475,310
data 475,310,492,321
data 492,321,502,346
data 502,346,523,365
data 523,365,530,364
data 530,364,530,343
data 530,343,504,301
data 504,301,463,301
data 463,301,432,304
'georgia
data 448,250,462,281
data 462,281,463,301
data 463,301,504,301
data 504,301,510,280
data 510,280,478,248
data 478,248,464,249
data 464,249,448,250
'hawaii
data 055,300,030,325
data 030,310,030,325
data 045,325,030,325
'idaho
data 132,057,124,091
data 124,091,110,140
data 110,140,141,147
data 141,147,172,151
data 172,151,177,119
data 177,119,160,118
data 160,118,148,102
data 148,102,148,089
data 148,089,143,059
data 143,059,132,057
'illinois
data 381,158,391,165
data 391,165,380,185
data 380,185,407,227
data 407,227,418,214
data 418,214,424,198
data 424,198,422,166
data 422,166,417,157
data 417,157,381,158
'indiana
data 422,165,424,198
data 424,198,418,214
data 418,214,439,210
data 439,210,450,197
data 450,197,446,164
data 446,164,422,165
'iowa
data 324,145,323,157
data 323,157,335,185
data 335,185,380,185
data 380,185,391,165
data 377,146,324,145
'kansas
data 265,187,264,225
data 264,225,345,226
data 345,226,345,204
data 345,204,339,190
data 339,190,265,187
'kentucky
data 418,214,401,235
data 401,235,472,228
data 472,228,487,218
data 487,218,478,205
data 478,205,450,197
data 450,197,439,210
data 439,210,418,214
'louisiana
data 352,279,352,291
data 352,291,356,305
data 356,305,354,317
data 354,317,376,321
data 376,321,397,314
data 397,314,407,317
data 407,317,405,310
data 405,310,405,303
data 405,303,382,303
data 382,303,389,288
data 389,288,388,279
data 388,279,352,279
'maine
data 581,101,590,127
data 590,127,596,116
data 596,116,623,098
data 623,098,620,091
data 620,091,611,088
data 611,088,602,069
data 602,069,588,070
data 588,070,585,092
data 585,092,581,101
'maryland
data 546,178,509,183
data 509,183,509,188
data 509,188,526,185
data 526,185,534,188
data 534,188,546,199
data 546,199,558,201
data 558,201,547,194
data 547,194,543,185
data 543,185,546,178
'massachusetts
data 566,136,567,146
data 567,146,579,142
data 579,142,587,149
data 587,149,595,144
data 595,144,589,136
data 589,136,590,127
data 590,127,575,132
data 575,132,566,136
'michigan
data 398,105,410,115
data 410,115,417,127
data 417,127,427,115
data 427,115,450,106
data 450,106,434,103
data 434,103,417,104
data 417,104,422,093
data 422,093,407,101
data 407,101,398,105
'michigan
data 445,116,433,127
data 433,127,429,141
data 429,141,431,152
data 431,152,422,165
data 422,165,446,164
data 446,164,465,162
data 465,162,472,151
data 472,151,466,135
data 466,135,456,139
data 456,139,460,129
data 460,129,457,118
data 457,118,445,116
'minnasota
data 335,185,339,190
data 339,190,344,204
data 344,204,345,226
data 345,226,345,235
data 345,235,395,235
data 395,235,399,244
data 399,244,401,235
data 401,235,407,227
data 407,227,380,185
data 380,185,335,185
'mississippi
data 321,079,324,115
data 324,115,324,145
data 324,145,377,146
data 377,146,366,130
data 366,130,366,119
data 366,119,369,109
data 369,109,383,106
data 383,106,395,090
data 395,090,376,089
data 376,089,361,080
data 361,080,321,079
'missouri
data 394,252,388,270
data 388,270,388,279
data 388,279,389,288
data 389,288,382,303
data 382,303,405,303
data 405,303,405,310
data 405,310,422,310
data 422,310,422,252
data 422,252,394,252
'montana
data 143,059,148,089
data 148,089,148,102
data 148,102,160,118
data 160,118,177,119
data 177,119,177,115
data 177,115,248,122
data 248,122,250,111
data 250,111,253,074
data 253,074,195,069
data 195,069,143,059
'nebraska
data 247,147,243,172
data 243,172,265,174
data 265,174,265,187
data 265,187,339,190
data 339,190,335,185
data 335,185,323,157
data 323,157,247,147
'nevada
data 077,133,068,170
data 068,170,117,218
data 117,218,122,219
data 122,219,124,210
data 124,210,141,147
data 141,147,110,140
data 110,140,077,133
'new hampshire
data 574,104,575,132
data 575,132,590,127
data 590,127,581,101
data 581,101,574,104
'new jersey
data 554,157,552,165
data 552,165,558,173
data 558,173,546,178
data 546,178,560,190
data 560,190,567,170
data 567,170,568,157
data 568,157,554,157
'new mexico
data 185,216,179,287
data 179,287,201,289
data 201,289,201,285
data 201,285,246,287
data 246,287,250,232
data 250,232,251,224
data 251,224,185,216
'new york
data 507,138,494,159
data 494,159,546,149
data 546,149,554,157
data 554,157,568,157
data 568,157,567,146
data 567,146,566,136
data 566,136,558,106
data 558,106,541,112
data 541,112,532,123
data 532,123,533,133
data 533,133,507,138
'north carolina
data 492,226,464,249
data 464,249,477,248
data 477,248,505,242
data 505,242,519,244
data 519,244,535,255
data 535,255,545,246
data 545,246,555,242
data 555,242,555,234
data 555,234,560,227
data 560,227,556,218
data 556,218,492,226
'north dakota
data 253,074,250,111
data 250,111,324,115
data 324,115,321,079
data 321,079,253,074
'ohio
data 446,164,450,197
data 450,197,478,205
data 478,205,496,185
data 496,185,494,159
data 494,159,464,163
data 464,163,446,164
'oklahoma
data 264,226,251,224
data 251,224,250,232
data 250,232,282,233
data 282,233,283,258
data 283,258,313,267
data 313,267,345,267
data 345,267,345,235
data 345,235,345,226
data 345,226,264,226
'oregon
data 060,072,039,124
data 039,124,077,133
data 077,133,110,140
data 110,140,124,091
data 124,091,066,083
data 066,083,060,072
'pennsylvania
data 494,159,496,185
data 496,185,546,178
data 546,178,558,173
data 558,173,552,165
data 552,165,554,157
data 554,157,546,149
data 546,149,494,159
'rhode island
data 575,142,579,152
data 579,152,587,149
data 587,149,579,142
data 579,142,575,142
'south carolina
data 478,248,510,280
data 510,280,535,255
data 535,255,519,244
data 519,244,505,242
data 505,242,478,248
'south dakota
data 250,111,250,121
data 250,121,247,147
data 247,147,323,157
data 323,157,324,145
data 324,145,324,115
data 324,115,250,111
'tennessee
data 401,235,399,244
data 399,244,394,252
data 394,252,422,252
data 422,252,448,250
data 448,250,464,249
data 464,249,492,226
data 492,226,472,228
data 472,228,401,235
'texas
data 250,232,246,287
data 246,287,201,285
data 210,285,201,289
data 201,289,235,325
data 235,325,242,315
data 242,315,261,315
data 261,315,287,362
data 287,362,310,368
data 310,368,313,344
data 313,344,323,334
data 323,334,336,334
data 336,334,342,320
data 342,320,354,317
data 354,317,356,305
data 356,305,352,291
data 352,291,352,273
data 352,273,346,268
data 346,268,314,268
data 314,268,283,259
data 283,259,282,232
data 282,232,250,232
'utah
data 141,147,124,210
data 124,210,185,216
data 185,216,190,167
data 190,167,169,164
data 169,164,172,151
data 172,151,141,147
'vermont
data 558,106,566,136
data 566,136,575,132
data 575,132,574,104
data 574,104,558,106
'virginia
data 487,218,472,228
data 472,228,492,226
data 492,226,464,249 rem 555,216
data 555,216,555,210
data 555,210,546,199
data 546,199,534,188
data 534,188,526,185
data 526,185,509,200
data 509,200,502,215
data 502,215,487,218
'washington
data 079,044,059,047
data 059,047,060,072
data 060,072,066,083
data 066,083,124,091
data 124,091,132,057
data 132,057,079,044
'west virginia
data 478,205,487,218
data 487,218,502,215
data 502,215,509,200
data 509,200,526,185
data 526,185,510,187
data 510,187,496,185
data 496,185,478,205
'wisconson
data 383,106,368,109
data 368,109,366,119
data 366,119,366,130
data 366,130,377,146
data 377,146,381,158
data 381,158,417,157
data 417,157,417,127
data 417,127,410,115
data 410,115,398,105
data 398,105,383,106
'wyoming
data 177,115,177,119
data 177,119,172,151
data 172,151,169,164
data 169,164,190,167
data 190,167,243,172
data 243,172,247,147
data 247,147,250,121
data 250,121,177,115

'end

label al_
data 7
data 422,252,422,310
data 422,310,432,310
data 432,310,432,304
data 432,304,463,301
data 463,301,462,281
data 462,281,448,250
data 448,250,422,252

label ak_
data 3
data 015,075,015,060
data 030,060,015,060
data 040,085,015,060

label az_
data 8
data 124,210,122,219
data 122,219,117,219
data 117,219,113,234
data 113,234,104,260
data 104,260,146,285
data 146,285,179,287
data 179,285,185,216
data 185,216,124,210

label ar_
data 9
data 345,235,345,267
data 345,267,352,273
data 352,273,352,279
data 352,279,388,279
data 388,279,388,270
data 388,270,394,252
data 394,252,399,244
data 399,244,395,235
data 395,235,345,235

label ca_
data 9
data 039,124,031,164
data 031,164,048,223
data 048,223,081,258
data 081,258,104,260
data 104,260,113,234
data 113,234,117,218
data 117,218,068,170
data 068,170,077,133
data 077,133,039,124

label co_
data 7
data 190,167,185,216
data 185,216,251,224
data 251,224,264,225
data 264,225,265,187
data 265,187,265,174
data 265,174,243,172
data 243,172,190,167

label ct_
data 4
data 567,146,568,158
data 568,158,579,152
data 579,152,576,144
data 576,144,567,146

label de_
data 5
data 546,178,543,185
data 543,185,547,194
data 547,194,558,201
data 558,201,560,190
data 560,190,546,178

label fl_
data 12
data 432,304,432,310
data 432,310,449,310
data 449,310,462,317
data 462,317,475,310
data 475,310,492,321
data 492,321,502,346
data 502,346,523,365
data 523,365,530,364
data 530,364,530,343
data 530,343,504,301
data 504,301,463,301
data 463,301,432,304

label ga_
data 7
data 448,250,462,281
data 462,281,463,301
data 463,301,504,301
data 504,301,510,280
data 510,280,478,248
data 478,248,464,249
data 464,249,448,250

label hi_
data 3
data 055,300,030,325
data 030,310,030,325
data 045,325,030,325

label id_
data 10
data 132,057,124,091
data 124,091,110,140
data 110,140,141,147
data 141,147,172,151
data 172,151,177,119
data 177,119,160,118
data 160,118,148,102
data 148,102,148,089
data 148,089,143,059
data 143,059,132,057

label il_
data 8
data 381,158,391,165
data 391,165,380,185
data 380,185,407,227
data 407,227,418,214
data 418,214,424,198
data 424,198,422,166
data 422,166,417,157
data 417,157,381,158

label in_
data 6
data 422,165,424,198
data 424,198,418,214
data 418,214,439,210
data 439,210,450,197
data 450,197,446,164
data 446,164,422,165

label ia_
data 5
data 324,145,323,157
data 323,157,335,185
data 335,185,380,185
data 380,185,391,165
'data 391,165,387,158
'data 387,158,377,146
data 377,146,324,145

label ks_
data 5
data 265,187,264,225
data 264,225,345,226
data 345,226,345,204
data 345,204,339,190
data 339,190,265,187

label ky_
data 7
data 418,214,401,235
data 401,235,472,228
data 472,228,487,218
data 487,218,478,205
data 478,205,450,197
data 450,197,439,210
data 439,210,418,214

label la_
data 12
data 352,279,352,291
data 352,291,356,305
data 356,305,354,317
data 354,317,376,321
data 376,321,397,314
data 397,314,407,317
data 407,317,405,310
data 405,310,405,303
data 405,303,382,303
data 382,303,389,288
data 389,288,388,279
data 388,279,352,279

label me_
data 9
data 581,101,590,127
data 590,127,596,116
data 596,116,623,098
data 623,098,620,091
data 620,091,611,088
data 611,088,602,069
data 602,069,588,070
data 588,070,585,092
data 585,092,581,101

label md_
data 9
data 546,178,509,183
data 509,183,509,188
data 509,188,526,185
data 526,185,534,188
data 534,188,546,199
data 546,199,558,201
data 558,201,547,194
data 547,194,543,185
data 543,185,546,178

label ma_
data 8
data 566,136,567,146
data 567,146,579,142
data 579,142,587,149
data 587,149,595,144
data 595,144,589,136
data 589,136,590,127
data 590,127,575,132
data 575,132,566,136

label mi_
data 21
data 398,105,410,115
data 410,115,417,127
data 417,127,427,115
data 427,115,450,106
data 450,106,434,103
data 434,103,417,104
data 417,104,422,093
data 422,093,407,101
data 407,101,398,105

data 445,116,433,127
data 433,127,429,141
data 429,141,431,152
data 431,152,422,165
data 422,165,446,164
data 446,164,465,162
data 465,162,472,151
data 472,151,466,135
data 466,135,456,139
data 456,139,460,129
data 460,129,457,118
data 457,118,445,116

label mo_
data 10
data 335,185,339,190
data 339,190,344,204
data 344,204,345,226
data 345,226,345,235
data 345,235,395,235
data 395,235,399,244
data 399,244,401,235
data 401,235,407,227
data 407,227,380,185
data 380,185,335,185

label mn_
data 11
data 321,079,324,115
data 324,115,324,145
data 324,145,377,146
data 377,146,366,130
data 366,130,366,119
data 366,119,369,109
data 369,109,383,106
data 383,106,395,090
data 395,090,376,089
data 376,089,361,080
data 361,080,321,079

label ms_
data 9
data 394,252,388,270
data 388,270,388,279
data 388,279,389,288
data 389,288,382,303
data 382,303,405,303
data 405,303,405,310
data 405,310,422,310
data 422,310,422,252
data 422,252,394,252

label mt_
data 10
data 143,059,148,089
data 148,089,148,102
data 148,102,160,118
data 160,118,177,119
data 177,119,177,115
data 177,115,248,122
data 248,122,250,111
data 250,111,253,074
data 253,074,195,069
data 195,069,143,059

label ne_
data 7
data 247,147,243,172
data 243,172,265,174
data 265,174,265,187
data 265,187,339,190
data 339,190,335,185
data 335,185,323,157
data 323,157,247,147

label nv_
data 7
data 077,133,068,170
data 068,170,117,218
data 117,218,122,219
data 122,219,124,210
data 124,210,141,147
data 141,147,110,140
data 110,140,077,133

label nh_
data 4
data 574,104,575,132
data 575,132,590,127
data 590,127,581,101
data 581,101,574,104

label nj_
data 7
data 554,157,552,165
data 552,165,558,173
data 558,173,546,178
data 546,178,560,190
data 560,190,567,170
data 567,170,568,157
data 568,157,554,157

label nm_
data 7
data 185,216,179,287
data 179,287,201,289
data 201,289,201,285
data 201,285,246,287
data 246,287,250,232
data 250,232,251,224
data 251,224,185,216

label ny_
data 11
data 507,138,494,159
data 494,159,546,149
data 546,149,554,157
data 554,157,568,157
data 568,157,567,146
data 567,146,566,136
data 566,136,558,106
data 558,106,541,112
data 541,112,532,123
data 532,123,533,133
data 533,133,507,138

label nc_
data 11
data 492,226,464,249
data 464,249,477,248
data 477,248,505,242
data 505,242,519,244
data 519,244,535,255
data 535,255,545,246
data 545,246,555,242
data 555,242,555,234
data 555,234,560,227
data 560,227,556,218
data 556,218,492,226

label nd_
data 4
data 253,074,250,111
data 250,111,324,115
data 324,115,321,079
data 321,079,253,074

label oh_
data 6
data 446,164,450,197
data 450,197,478,205
data 478,205,496,185
data 496,185,494,159
data 494,159,464,163
data 464,163,446,164

label ok_
data 9
data 264,226,251,224
data 251,224,250,232
data 250,232,282,233
data 282,233,283,258
data 283,258,313,267
data 313,267,345,267
data 345,267,345,235
data 345,235,345,226
data 345,226,264,226

label or_
data 6
data 060,072,039,124
data 039,124,077,133
data 077,133,110,140
data 110,140,124,091
data 124,091,066,083
data 066,083,060,072

label pa_
data 7
data 494,159,496,185
data 496,185,546,178
data 546,178,558,173
data 558,173,552,165
data 552,165,554,157
data 554,157,546,149
data 546,149,494,159

label ri_
data 4
data 575,142,579,152
data 579,152,587,149
data 587,149,579,142
data 579,142,575,142

label sc_
data 5
data 478,248,510,280
data 510,280,535,255
data 535,255,519,244
data 519,244,505,242
data 505,242,478,248

label sd_
data 6
data 250,111,250,121
data 250,121,247,147
data 247,147,323,157
data 323,157,324,145
data 324,145,324,115
data 324,115,250,111

label tn_
data 8
data 401,235,399,244
data 399,244,394,252
data 394,252,422,252
data 422,252,448,250
data 448,250,464,249
data 464,249,492,226
data 492,226,472,228
data 472,228,401,235

label tx_
data 21
data 250,232,246,287
data 246,287,201,285
data 210,285,201,289
data 201,289,235,325
data 235,325,242,315
data 242,315,261,315
data 261,315,287,362
data 287,362,310,368
data 310,368,313,344
data 313,344,323,334
data 323,334,336,334
data 336,334,342,320
data 342,320,354,317
data 354,317,356,305
data 356,305,352,291
data 352,291,352,273
data 352,273,346,268
data 346,268,314,268
data 314,268,283,259
data 283,259,282,232
data 282,232,250,232

label ut_
data 6
data 141,147,124,210
data 124,210,185,216
data 185,216,190,167
data 190,167,169,164
data 169,164,172,151
data 172,151,141,147

label vt_
data 4
data 558,106,566,136
data 566,136,575,132
data 575,132,574,104
data 574,104,558,106

label va_
data 10
data 487,218,472,228
data 472,228,492,226
data 492,226,555,216
data 555,216,555,210
data 555,210,546,199
data 546,199,534,188
data 534,188,526,185
data 526,185,509,200
data 509,200,502,215
data 502,215,487,218

label wa_
data 6
data 079,044,059,047
data 059,047,060,072
data 060,072,066,083
data 066,083,124,091
data 124,091,132,057
data 132,057,079,044

label wv_
data 7
data 478,205,487,218
data 487,218,502,215
data 502,215,509,200
data 509,200,526,185
data 526,185,510,187
data 510,187,496,185
data 496,185,478,205

label wi_
data 10
data 383,106,368,109
data 368,109,366,119
data 366,119,366,130
data 366,130,377,146
data 377,146,381,158
data 381,158,417,157
data 417,157,417,127
data 417,127,410,115
data 410,115,398,105
data 398,105,383,106

label wy_
data 8
data 177,115,177,119
data 177,119,172,151
data 172,151,169,164
data 169,164,190,167
data 190,167,243,172
data 243,172,247,147
data 247,147,250,121
data 250,121,177,115

label vc_
data 1
data 480,520,500,520

label cm_
data 1
data 480,535,500,535


17
Yabasic / Rain Effect
« on: May 31, 2025 »
Rain with depth field.

Code: [Select]
rain=350
dim x(rain)
dim y(rain)
dim z(rain)
dim ht(rain)
dim sp(rain)
dim x1(rain)
dim z1(rain)

for a=1 to rain
x(a)=int(ran(640))
y(a)=int(ran(512))
z(a)=int(ran(500))-10
ht(a)=(1/((512-z(a))/10))*200
sp(a)=ht(a)/2
x1(a)=x(a)
z1(a)=z(a)
next a

open window 640,512
repeat
setdrawbuf vm
vm=1-vm
setdispbuf vm
clear window

setrgb 1,100,100,256
fill rectangle 1,1 to 639,511
setrgb 1,256,256,256

for a=1 to rain
y(a)=y(a)+sp(a)
if y(a)>520 y(a)=-20
line x(a),y(a) to x(a),y(a)-ht(a)/3
next a

until(1=0)


18
Yabasic / Quiz Game
« on: May 31, 2025 »
mutichoice format countries and capitals
Code: [Select]
dim Q$(995)
dim A(995)
dim f(995)
dim t(995)

for a=1 to 995
read Q$(a)
read A(a)
next a

'keys=16
'dim go(keys)
'dim g(keys)

sel=990
row=1

open window 640,512
repeat
setdrawbuf vm
vm=1-vm
setdispbuf vm
clear window

text 100,100,"What is the capital of"

for a=1+sel to 5+sel
if row=a-sel then
setrgb 1,0,256,0
else
setrgb 1,256,256,256
endif
if a>1+sel text 110,(a-sel)*20+100,Q$(a)
setrgb 1,256,256,0
if a=1+sel text 110,(a-sel)*20+100,upper$(Q$(a))
setrgb 1,256,256,256
text 80,(a-sel)*20+100,chr$(a+95-sel)+"."
next a

g$=inkey$(0)

if g$="'" row=1
if g$="a" row=2
if g$="b" row=3
if g$="c" row=4
if g$="d" row=5

for a=1+sel to 5+sel
if row=a-sel and g$="enter" f(a)=1
if f(a)=1 t(a)=t(a)+1

if t(a)>100 then
if row=1 sel=sel1
if row>1 sel=int(ran(199))*5
f(a)=0
t(a)=0
row=1
endif

if f(a)=1 then
if A(a)=0 text 110,220,"No. That's wrong."
if A(a)=1 text 110,220,"You got it right."
if A(a)=2 text 110,220,"Quiz is starting."
if A(a)=4 text 110,220,"That's the question dummy"
if A(a)=4 text 110,235,"Pick a letter. Try again."
if A(a)=4 sel1=sel
endif

next a

c=peek("port1")
for a=2+sel to 5+sel
if and(c,1)<>0 text (a-sel)*20+60,250,str$(A(a))
next a

until (1=0)

data "Afghanistan",4,"Herat",0,"Kabul",1,"Kandahar",0,"Kunduz",0
data "Albania",4,"Vlore",0,"Shkoder",0,"Durres",0,"Tirana",1
data "Algeria",4,"Oran",0,"Qacentina",0,"Algiers",1,"Beskra",0
data "Andorra",4,"Engordany",0,"Andorra La Vella",1,"Arinsal",0,"Canillo",0
data "Angola",4,"Uige",0,"Malanje",0,"Lubango",0,"Luanda",1
data "Antigua",4,"Saint Johns",1,"Potters Village",0,"Willikies",0,"Urlings",0
data "Argentina",4,"Cordoba",0,"Buenos Aires",1,"Mar Del Plata",0,"Rosano",0
data "Armenia",4,"Vanadzor",0,"Jermuk",0,"Gyumri",0,"Yerevan",1
data "Australia",4,"Sydney",0,"Melbourne",0,"Canberra",1,"Brisbane",0
data "Austria",4,"Vienna",1,"Graz",0,"Linz",0,"Salzburg",0
data "Azerbaijan",4,"Ganja",0,"Mingachevir",0,"Sumgait",0,"Baku",1
data "Bahamas",4,"Congo Town",0,"Nassau",1,"Owens Town",0,"Moxey Town",0
data "Bahrain",4,"Muharraq",0,"Hamad Town",0,"Manama",1,"Riffa",0
data "Bangladesh",4,"Dhaka",1,"Chittagong",0,"Khulna",0,"Rajshahi",0
data "Barbados",4,"Charnocks",0,"Saint John",0,"Bridgetown",1,"Speights Town",0
data "Belarus",4,"Minsk",1,"Grodno",0,"Gomel",0,"Vitebsk",0
data "Belgium",4,"Antwerp",0,"Charleroi",0,"Ghent",0,"Brussels",1
data "Belize",4,"San Ignacio",0,"Belmopan",1,"Belize City",0,"Dangriga",0
data "Benin",4,"Malanville",0,"Cotonou",0,"Porto Novo",1,"Sakete",0
data "Bhutan",4,"Thimphu",1,"Jaigaon",0,"Sakteng",0,"Paro",0
data "Bolivia",4,"Cochabamba",0,"El Alto",0,"La Paz",1,"Sucre",1
data "Bosnia",4,"Banja Luka",0,"Zenica",0,"Sarajevo",1,"Mostar",0
data "Botswana",4,"Gaborone",1,"Francis Town",0,"Ghanzi",0,"Maun",0
data "Brazil",4,"Sao Paulo",0,"Brasilia",1,"Belem",0,"Curitiba",0
data "Brunei",4,"Tutong",0,"Liang",0,"Kuala Belait",0,"Bandar Seri Begawan",1
data "Bulgaria",4,"Varna",0,"Sofia",1,"Plovdiv",0,"Burgas",0
data "Burkina Faso",4,"Ouahigouya",0,"Bobo Dioulasso",0,"Ouagadougou",1,"Koudougou",0
data "Burundi",4,"Bujumbura",0,"Bubanza",0,"Gitega",1,"Ngozi",0
data "Cabo",4,"Santiago",0,"Miraflores",0,"Verde Praia",1,"Caduano",0
data "Cambodia",4,"Bat Dambang",0,"Sihanoukville",0,"Siem Reap",0,"Phnom Penh",1
data "Cameroon",4,"Douala",0,"Yaounde",1,"Bamenda",0,"Bafoussam",0
data "Canada",4,"Ottawa",1,"Toronto",0,"Montreal",0,"Calgary",0
data "Central African Republic",4,"Bimbo",0,"Bangui",1,"Begoua",0,"Carnot",0
data "Chad",4,"Am Timan",0,"Mongo",0,"Moundou",0,"N'Djamena",1
data "Chile",4,"Vina Del Mar",0,"Antofagasta",0,"Santiago",1,"Puente Alto",0
data "China",4,"Beijing",1,"Tianjin",0,"Shenzhen",0,"Shanghai",0
data "Columbia",4,"Cali",0,"Bogota",1,"Cartagena",0,"Medellin",0
data "Comoros",4,"Moheli",0,"Anjouan",0,"Mayoette",0,"Moroni",1
data "Congo D",4,"Kinshasa",1,"Lubumbashi",0,"Mbuji Mayi",0,"Kananga",0
data "Congo R",4,"Pointe Noire",0,"Brazzaville",1,"Dolisie",0,"Nkayi",0
data "Costa Rica",4,"Ala Juela",0,"Desamparados",0,"Cartago",0,"San Jose",1
data "Cote D'Ivoire",4,"Abdijan",1,"Yamoussoukro",1,"Dimbokro",0,"Sassandra",0
data "Croatia",4,"Split",0,"Rijeka",0,"Zagreb",1,"Ozijek",0
data "Cuba",4,"Havana",1,"Santiago De Cuba",0,"Holguin",0,"Camaguey",0
data "Cyprus",4,"Lemesos",0,"Peyia",0,"Nicosia",1,"Larnaca",0
data "Czech R",4,"Brno",0,"Prague",1,"Ostrava",0,"Pizen",0
data "Denmark",4,"Aarhus",0,"Aalborg",0,"Odense",0,"Copenhagen",1
data "Djibouti",4,"Ali Sabih",0,"Dikhil",0,"Djibouti City",1,"Obock",0
data "Dominica",4,"Roseau",1,"Massacre",0,"Lauat",0,"Portsmouth",0
data "Dominican R",4,"Santo Domingo Este",0,"Santo Domingo Norte",0,"Santo Domingo",1,"Santo Domingo Oeste",0
data "Ecuador",4,"Guayaquil",0,"Santo Domingo e Los Colorados",0,"Duran",0,"Quito",1
data "Egypt",4,"Cairo",1,"Alexandria",0,"Giza",0,"Shubra El Kheima",0
data "El Salvador",4,"Soya Pango",0,"Santa Ana",0,"San Salvador",1,"San Miguel",0
data "Equatorial Guinea",4,"Bata",0,"Malabo",1,"Evinayong",0,"Mongomo",0
data "Eritrea",4,"Asmara",1,"Assab",0,"Teseney",0,"Keren",0
data "Estonia",4,"Parnu",0,"Vilijandi",0,"Tartu",0,"Tallinn",1
data "Ethiopia",4,"Hawassa",0,"Addis Ababa",1,"Dire Dawa",0,"Gondar",0
data "Fiji",4,"Buca",0,"Lautoka",0,"Labasa",0,"Suva",1
data "Finland",4,"Espoo",0,"Helsinki",1,"Tampere",0,"Vantaa",0
data "France",4,"Paris",1,"Lyon",0,"Marseille",0,"Toulouse",0
data "Gabon",4,"Port Gentil",0,"Franceville",0,"Lambarene",0,"Liberville",1
data "Gambia",4,"Bintang",0,"Georgetown",0,"Banjul",1,"Faratenni",0
data "Georgia",4,"Batumi",0,"Tbilisi",1,"Rustavi",0,"Kutaisi",0
data "Germany",4,"Berlin",1,"Cologne",0,"Hamburg",0,"Munich",0
data "Ghana",4,"Kumasi",0,"Tema",0,"Accra",1,"Tamale",0
data "Greece",4,"Thessaloniki",0,"Piraeus",0,"Patras",0,"Athens",1
data "Grenada",4,"Grand Roy",0,"Saint Georges",1,"Grenville",0,"Victoria",0
data "Guatamala",4,"Guatemala City",1,"Mixco",0,"Villa Nueva",0,"Quetzaltenango",0
data "Guinea",4,"Nzerekore",0,"Kankan",0,"Conakry",1,"Maneah",0
data "Guinea-Bissau",4,"Nova Lamego",0,"Buba",0,"Cato",0,"Bissau",1
data "Guyana",4,"Georgetown",1,"Mabaruma",0,"Parika",0,"Bartica",0
data "Haiti",4,"Cap Haitien",0,"Carrefour",0,"Port Au Prince",1,"Delmas",0
data "Honduras",4,"Choloma",0,"Tegucigalpa",1,"Danli",0,"San Pero Sula",0
data "Hungary",4,"Debrecen",0,"Gyor",0,"Szeged",0,"Budapest",1
data "Iceland",4,"Reykjavik",1,"Akranes",0,"Reykholt",0,"Kirkjubaejarklaustur",0
data "India",4,"Ahmadabad",0,"Bangalore",0,"New Delhi",1,"Mumbai",0
data "Indonesia",4,"Jakarta",1,"Medan",0,"Depok",0,"Surabaya",0
data "Iran",4,"Mashhad",0,"Tehran",1,"Karaj",0,"Esfahan",0
data "Iraq",4,"Al Basrah",0,"Al Mawsli",0,"Kirkuk",0,"Baghdad",1
data "Ireland",4,"Cork",0,"Waterford",0,"Dublin",1,"Kilkenny",0
data "Israel",4,"Jerusalem",1,"Tel Aviv Yafo",0,"Rishon Leziyyon",0,"Petah Tikva",0
data "Italy",4,"Milan",0,"Turin",0,"Rome",1,"Genoa",0
data "Jamaica",4,"Portmore",0,"Kingston",1,"Spanish Town",0,"Montego Bay",0
data "Japan",4,"Yokohama",0,"Sapporo",0,"Osaka",0,"Tokyo",1
data "Jordan",4,"Amman",1,"Irbid",0,"Russiefa",0,"Zarqa",0
data "Kazakhstan",4,"Almaty",0,"Shimkent",0,"Nur Sultan",1,"Karaganda",0
data "Kenya",4,"Nakuru",0,"Nairobi",1,"Mombasa",0,"Kisumu",0
data "Kiribati",4,"Betio",0,"Bon Riki",0,"Tarawa Atoll",1,"South Tarawa",0
data "Kosovo",4,"Pristina",1,"Zubin Poroc",0,"Mitrovica",0,"Malshava",0
data "Kuwait",4,"Hawally",0,"Kuwait City",1,"Farwaniya",0,"Fintas",0
data "Kyrgyzstan",4,"Osh",0,"Jalel Abad",0,"Tokmok",0,"Bishkek",1
data "Laos",4,"Champhone",0,"Vientiane",1,"Kaysone Phomvihane",0,"Salavan",0
data "Latvia",4,"Riga",1,"Rezekne",0,"Jelgava",0,"Liepaja",0
data "Lebanon",4,"Tripoli",0,"Zgharta",0,"Beirut",1,"Gharziyeh",0
data "Lesotho",4,"Maseru",1,"Pitseng",0,"Mafeteng",0,"Mokhotlong",0
data "Liberia",4,"Tubmanburg",0,"Buchanan",0,"Greenville",0,"Monrovia",1
data "Libya",4,"Benghazi",0,"Misrata",0,"Tripoli",1,"Sabha",0
data "Liechtenstein",4,"Triesenberg",0,"Vaduz",1,"Balzers",0,"Ruggell",0
data "Lithuania",4,"Vilnius",1,"Kaunas",0,"Klaipeda",0,"Siauliai",0
data "Luxembourg",4,"Petange",0,"Esch",0,"Remich",0,"Luxembourg",1
data "Madagascar",4,"Toamasina",0,"Antananarivo",1,"Antsirabe",0,"Mahajanga",0
data "Malawi",4,"Blantyre",0,"Mzuzu",0,"Lilongwe",1,"Zomba",0
data "Malaysia",4,"Kuala Lumpur",1,"Kajang",0,"Seberang Jaya",0,"Shah Alam",0
data "Maldives",4,"Ari",0,"Male",1,"Malaku",0,"Goidhoo",0
data "Mali",4,"Bamako",1,"Kayes",0,"Koutiala",0,"Segou",0
data "Malta",4,"Harurun",0,"Bormia",0,"Birkirkara",0,"Valetta",1
data "Marshall Islands",4,"Bikini",0,"Maloelap",0,"Jemo",0,"Majuro",1
data "Mauritania",4,"Boutlimit",0,"Nouakchott",1,"Nouadhibou",0,"Chinguetti",0
data "Mauritius",4,"Quatre Bornes",0,"Vacoas Phoenix",0,"Port Louis",1,"Curepipe",0
data "Mexico",4,"Tijuana",0,"Mexico City",1,"Puebla",0,"Leon",0
data "Micronesia",4,"Palikir",1,"Gaferut",0,"Ponape",0,"Faraulep",0
data "Moldova",4,"Chisinau",1,"Tiraspol",0,"Dubasari",0,"Comrat",0
data "Monaco",4,"Monte Carlo",0,"Larvotto",0,"Eze",0,"Monaco",1
data "Mongolia",4,"Urdenet",0,"Ulaanbaatar",1,"Arhangay",0,"Selenge",0
data "Montenegro",4,"Niksic",0,"Bijela",0,"Podgorica",1,"Kolasin",0
data "Morocco",4,"Fes",0,"Rabat",1,"Tanger",0,"Casablanca",0
data "Mozambique",4,"Nampula",0,"Beira",0,"Matola",0,"Maputo",1
data "Myanmar",4,"Naypyidaw",1,"Mandalay",0,"Yangon",0,"Bago",0
data "Namibia",4,"Rundu",0,"Walvis Bay",0,"Windhoek",1,"Ondangwa",0
data "Nauru",4,"Ronave",0,"Anibare",0,"Anabar",0,"Yaren",1
data "Nepal",4,"Biratnagar",0,"Kathmandu",1,"Pokhara",0,"Lalitpur",0
data "Netherlands",4,"Amsterdam",1,"Rotterdam",0,"Hague",0,"Utecht",0
data "New Zealand",4,"Auckland",0,"Wellington",1,"Christchurch",0,"Dunedin",0
data "Nicaragua",4,"Chinandiga",0,"Leon",0,"Managua",1,"Masaya",0
data "Niger",4,"Maradi",0,"Zinder",0,"Tahoua",0,"Niamey",1
data "Nigeria",4,"Benin City",0,"Abuja",1,"Ibadan",0,"Lagos",0
data "North Korea",4,"Pyongyang",1,"Chongjin",0,"Hamhung",0,"Kaechon",0
data "North Macedonia",4,"Vinica",0,"Veles",0,"Skopje",1,"Gostivar",0
data "Norway",4,"Bergen",0,"Trondheim",0,"Stavanger",0,"Oslo",1
data "Oman",4,"Seeb",0,"Muscat",1,"Salalah",0,"Sohar",0
data "Pakistan",4,"Islamabad",1,"Hyderabad",0,"Karachi",0,"Lahore",0
data "Palau",4,"Melekeok",1,"Aimeliik",0,"Ngerulmud",0,"Airai",0
data "Palestine",4,"Gaza",0,"Khan Yunis",0,"Hebron",0,"Jerusalem",1
data "Panama",4,"San Miguelito",0,"Panama City",1,"La Chorrera",0,"Colon",0
data "Papua New Guinea",4,"Port Moresby",1,"Lae",0,"Wonehara",0,"Morehead",0
data "Paraguay",4,"Ciudad Del Este",0,"Luque",0,"Asuncion",1,"Capiata",0
data "Peru",4,"Trujillo",0,"Arequipa",0,"Chiclayo",0,"Lima",1
data "Philippines",4,"Davao City",0,"Manila",1,"Quezon City",0,"Caloocan",0
data "Poland",4,"Warsaw",1,"Krakow",0,"Wroclaw",0,"Gdansk",0
data "Porto Rico",4,"Bayamon",0,"Carolina",0,"Ponce",0,"San Juan",1
data "Portugal",4,"Sintra",0,"Vila Nova De Gaia",0,"Lisbon",1,"Braga",0
data "Qatar",4,"Al Sawa",0,"Dukhan",0,"Ar Rayyan",0,"Doha",1
data "Romania",4,"Constanta",0,"Bucharest",1,"Lasi",0,"Cluj Napoca",0
data "Russia",4,"Volgograd",0,"Saint Petersburg",0,"Yekaterinburg",0,"Moscow",1
data "Rwanda",4,"Gisenyi",0,"Ruhengeri",0,"Kigali",1,"Byumba",0
data "Saint Kitts",4,"Basseterre",1,"Tabernacle",0,"Trinity",0,"Frigate Bay",0
data "Saint Lucia",4,"Castries",1,"San Soucis",0,"Roseau",0,"Micoud",0
data "Saint Vincent",4,"Kingstown",1,"Georgetown",0,"Saine George",0,"Saine David",0
data "Samoa",4,"Asau",0,"Apia",1,"Satapuala",0,"Lalomanu",0
data "San Marino",4,"San Giovanni",0,"Fiorentino",0,"Faetano",0,"San Marino",1
data "Sao Tome",4,"Guadelupe",0,"Samhana",0,"Sao Tome",1,"Neves",0
data "Saudi Arabia",4,"Bahrain",0,"Riyadh",1,"Mecca",0,"Halaban",0
data "Senegal",4,"Dakar",1,"Touba",0,"Thies",0,"Kaolack",0
data "Serbia",4,"Novisad",0,"Nis",0,"Belgrade",1,"Kragujevac",0
data "Seychelles",4,"Port Gloud",0,"Victoria",1,"Takamaka",0,"Aryse Royale",0
data "Sierra Leone",4,"Kenema",0,"Bo",0,"Koidu",0,"Freetown",1
data "Singapore",4,"Singapore",1,"Choa Chu Kang",0,"Toa Payoh",0,"Kranji",0
data "Slovakia",4,"Kosice",0,"Nitra",0,"Presnov",0,"Bratislava",1
data "Slovenia",4,"Ljubljana",1,"Maribor",0,"Bistrica",0,"Brezice",0
data "Solomon Islands",4,"Kirakira",0,"Buala",0,"Honiara",1,"Gizo",0
data "Somalia",4,"Hargeysa",0,"Mogadishu",1,"Jowhar",0,"Baydhaba",0
data "South Africa",4,"Pretoria",1,"Durbin",0,"Johannesburg",0,"Cape Town",1
data "South Korea",4,"Busan",0,"Daegu",0,"Seoul",1,"Incheon",0
data "South Sudan",4,"Wau",0,"Juba",1,"Malakal",0,"Yambio",0
data "Spain",4,"Madrid",1,"Valencia",0,"Zaragoza",0,"Barcelona",0
data "Sri Lanka",4,"Colombo",1,"Dehiwala Mt Lavinia",0,"Jayawardenepura",1,"Moratuwa",0
data "Sudan",4,"Nyala",0,"Umm Durman",0,"Al Khartum Bahri",0,"Khartoum",1
data "Suriname",4,"Brokopondo",0,"Paramaribo",1,"Groningen",0,"Onverwacht",0
data "Swaziland",4,"Mankanyane",0,"Sidvokodvo",0,"Mbabane",1,"Bhunya",0
data "Sweden",4,"Stockholm",1,"Gothenburg",0,"Malmo",0,"Uppsala",0
data "Switzerland",4,"Geneva",0,"Zurich",0,"Basel",0,"Bern",1
data "Syria",4,"Aleppo",0,"Homs",0,"Damascus",1,"Idleb",0
data "Taiwan",4,"Taipei",1,"Kaohsiung",0,"Taichung",0,"Taoyuan",0
data "Tajikistan",4,"Bokhtar",0,"Dushanbe",1,"Khujand",0,"Kulob",0
data "Tanzania",4,"Dodoma",1,"Arusha",0,"Mwanza",0,"Dar Es Salaam",1
data "Thailand",4,"Nonthaburi",0,"Pah Kret",0,"Hat Yai",0,"Bangkok",1
data "Timor-Leste",4,"Los Palos",0,"Maliana",0,"Dili",1,"Viqueque",0
data "Togo",4,"Notse",0,"Lome",1,"Kpalime",0,"Atakpame",0
data "Tonga",4,"Nuku'alofa",1,"Kolonga",0,"Nukunuku",0,"Fatuma",0
data "Trinidad & Tobago",4,"Arima",0,"Mayaro",0,"San Fernando",0,"Port Of Spain",1
data "Tunisia",4,"Sfax",0,"Sousse",0,"Tunis",1,"La Soukra",0
data "Turkey",4,"Istanbul",0,"Ankara",1,"Bursa",0,"Adana",0
data "Turkmenistan",4,"Ashgabat",1,"Dasoguz",0,"Mary",0,"Turkmenabat",0
data "Tuvalu",4,"Nauru",0,"Kiribati",0,"Vaiaku",1,"Funafuti",1
data "Uganda",4,"Nansana",0,"Kira",1,"Kampala",1,"Ssabagabo",0
data "Ukraine",4,"Kharkiv",0,"Kyiv",1,"Odesa",0,"Donetsk",0
data "United Arab Emirates",4,"Abu Dhabi",1,"Dubai",0,"Sharjah",0,"Al Ain",0
data "United Kingdom",4,"Birmingham",0,"Glasgow",0,"Manchester",0,"London",1
data "United States Of America",4,"New York",0,"Los Angeles",0,"Washington DC",1,"Chicago",0
data "Uruguay",4,"Salto",0,"Montevideo",1,"Tacuarembo",0,"Colonia",0
data "Uzbekistan",4,"Tashkent",1,"Andijan",0,"Namangan",0,"Bukhara",0
data "Vanuatu",4,"Norsap",0,"Luganville",0,"Tabwemanasana",0,"Port Vila",1
data "Vatican City",4,"Musei Vaticani",0,"Palazzo Apostolico",0,"Vatican City",1,"Casa Bonus Pastor",0
data "Venezuela",4,"San Cristobal",0,"Caracas",1,"Puerto La Cruz",0,"Petare",0
data "Vietnam",4,"Hanoi",1,"Ho Chi Minh",0,"Hai Phong",0,"Da Nang",0
data "Yemen",4,"Aden",0,"Al Hudayda",0,"Taiz",0,"Sanaa",1
data "Zambia",4,"Chipata",0,"Kitwe",0,"Lusaka",1,"Ndola",0
data "Zimbabwe",4,"Bulawayo",0,"Harare",1,"Citungwiza",0,"Mutare",0
'data " menu ",4,"Use D-Pad,",2,"'up' or 'down'",2,"to select your answer",2,"and then 'right'",2
data " menu ",2,"use letter keys",2,"to select your answer",2,"and then 'enter'",2,"questions are randomly selected",2

19
Yabasic / input type search redux
« on: July 14, 2023 »
This is better version on a previous upload.

With same data sample.

It has search high lighting.

And backspace clear input.

Code: [Select]
restore message
read words
dim num(words)
dim word$(words)

for a=1 to words
read num(a)
read word$(a)
next a

word=12
dim z$(word)

open window 640,512
repeat

for a=1 to word
z$(a)=""
next a

clear window

for a=1 to word
text 440,20,"enter search letters"
z$(a)=inkey$

if z$(a)="backspace" then
z$(a)=""
a=a-2
if a<0 a=0
endif

text 300,20,z$(a)

clear window

b$=z$(1)+z$(2)+z$(3)+z$(4)+z$(5)+z$(6)
b$=b$+z$(7)+z$(8)+z$(9)+z$(10)+z$(11)+z$(12)

text 540,40,b$

row=0
col=0
y=0
wrd=0

for b=1 to words
if instr(word$(b),b$)<>0 then
row=row+1
if num(b)<10 sp=10
if num(b)>9 and num(b)<100 sp=0
if num(b)>99 sp=-10
text sp+10,row*18+8,str$(num(b))

for c=1 to len(word$(b))
y=y+1

if mid$(word$(b),c,len(b$))=b$ then
wrd=wrd+1
setrgb 1,256,0,0
fill rectangle y*10+30,row*18-2 to y*10+30+(len(b$)*10),row*18+11
endif

next c

setrgb 1,256,256,256
text 40,row*18+8,word$(b)
y=0
endif

next b

if len(b$)<2 text 540,60,str$(a)+" letter"
if len(b$)>1 text 540,60,str$(a)+" letters"
text 540,80,str$(row)+" lines"
text 540,100,str$(wrd)+" matches"
text 540,120,"backspace"
text 540,132,"to delete"

next a

until (1=0)
 
label message
data 115
data 1,"service as listed "
data 2,"have a happy day !"
data 5,"cabinets recieved without any grilles "
data 6,"cabinets recieved with grilles "
data 7,"cabinets in poor condition "
data 9,"hold - customer currently on stop credit "
data 10,"all work guaranteed for 90 days "
data 11,"operates but not guaranteed to orig spec "
data 12,"job done at customer request no warranty "
data 13,"under warranty - no charge"
data 14,"special price - new fault to last repair"
data 15,"reconed to original specifications "
data 16,"repaired/reconed with substitute parts  "
data 17,"repaired with original manufacturer part "
data 18,"no parts available - agent/manufacturer "
data 19,"no replacement drivers available "
data 20,"charge as quoted "
data 21,"supply reconditioned unit "
data 22,"supply new speaker unit "
data 23,"no job - unit not worth repairing"
data 25,"test on speaker - unit is ok"
data 26,"parts supplied by customer "
data 30,"remove software and clean frame "
data 31,"reassemble old software and test "
data 32,"fit new software and test "
data 33,"strip, clean, fit new software to driver "
data 34,"fit reclaimed surrounds as new not avail "
data 35,"fit new foam surrounds to speaker "
data 36,"replace braids on speaker "
data 37,"adapt surround to fit "
data 40,"replace voice coil in speaker drive unit "
data 41,"repair open circuit in speaker driver "
data 42,"repair voice coil/former in speaker  "
data 43,"manufacture custom voice coil & fit"
data 44,"recenter voice coil assembly "
data 45,"remove diaphragm assembly "
data 46,"replace diaphragm assembly "
data 47,"voice coil impedance not as original "
data 48,"physical damamge due to overdriving unit "
data 49,"thermal damage to coil - excessive power"
data 50,"demagnetise, strip and clean magnet assembly "
data 51,"assemble and magnetise magnet assembly "
data 52,"demagnetise and clean magnet assembly "
data 53,"remagnetise loudspeaker "
data 54,"clean magnet assembly and voice coil gap "
data 55,"remove dirt from voice coil gap "
data 56,"remove magnet assembly from frame "
data 57,"refit & recenter magnet assy to frame "
data 58,"realign magnet/frame "
data 59,"check crossover networks & connections"
data 60,"test and remove faulty drivers from cab "
data 61,"refit drivers to cabinet and test "
data 62,"remove drivers from cabs and test "
data 63,"repair cabinet enclosure "
data 64,"replace faulty capacitors "
data 65,"remove xover, repair and refit "
data 66,"replace l-pad attenuators "
data 67,"fit new input terminals "
data 68,"remove old grille cloth from frame "
data 69,"fit new grille cloth to frame "
data 70,"speaker number one "
data 71,"speaker number two "
data 72,"speaker number three "
data 73,"speaker number four "
data 74,"passive radiator "
data 75,"bass unit "
data 76,"midrange unit "
data 77,"tweeter unit "
data 78,"crossover "
data 79,"cabinet "
data 80,"replace cone "
data 81,"repair cone "
data 82,"strengthen apex of cone "
data 83,"repair cone damage caused by cone shear "
data 84,"remove and reglue cone surround to frame "
data 85,"reglue cone / damper to voice coil"
data 86,"plastiflex cone and refit dustcap "
data 87,"treat surround with damping compound "
data 88,"fit new dustcap to speaker "
data 89,"fit new twincone to speaker "
data 90,"fit new damper to speaker "
data 91,"fit new gaskets to speaker "
data 92,"remove mid/tweeter assembly "
data 93,"refit mid/tweeter assembly "
data 94,"remove dustcap from speaker "
data 95,"refit dustcap to speaker "
data 96,"remove gaskets from speaker "
data 97,"refit gaskets to speaker "
data 99,"full laser clean and service "
data 100,"dismantle, clean pots & switches"
data 101,"check power supply and output"
data 102,"trace and repair dry joints on pcb"
data 103,"repair faulty output stage "
data 104,"reassemble & test"
data 106,"check pcb and capacitors "
data 107,"clean heads and transport "
data 108,"replace faulty output stage "
data 109,"replace faulty transformer "
data 110,"replace resistors "
data 111,"replace transistors "
data 112,"replace integrated circuit "
data 113,"clean heatsinks and pcb "
data 114,"replace drive belt "
data 115,"replace laser assembly "
data 116,"replace fuses "
data 117,"replace switch "
data 120,"we do not quote for jobs which can be "
data 121,"repaired within the investigation time "
data 123,"minimum charge for inspecting speaker "
data 124,"and costing parts and labour and quoting "
data 125,"replace mains plug "
data 126,"replace mains cable/plug "
data 127,"replace audio cable/plug "
data 128,"sold via trade-me ref: "
data 129,"item fully tested before despatch "

20
Yabasic / Matrix Dataless
« on: December 07, 2021 »
Short and sweet.

A mistake corrected.
Maybe it was noticed.
14/07/23

Code: [Select]
tails=50
tail=12
dim gap(tails)
dim go(tails)
dim en(tails)
dim x(tails)
dim y(tails)
dim z(tail,tails)
for a=1 to tails
gap(a)=1
en(a)=int(ran(100))/10
x(a)=(a-1)*12.8
y(a)=int(ran(50))*12
for b=1 to tail
z(b,a)=int(ran(223))+32
'z(b,a)=int(ran(2)) rem this sets up 0's and 1's
next b
next a
open window 640,512
repeat
setdrawbuf vm
vm=1-vm
setdispbuf vm
clear window
for a=1 to tails
go(a)=go(a)+gap(a)
en(a)=en(a)+.1
if en(a)>10 en(a)=0
if go(a)>en(a) go(a)=1
if go(a)>en(a)-1 y(a)=y(a)+12
if y(a)>520+(tail*12) then
y(a)=0
'for b=1 to tail
'z(b,a)=int(ran(2))
''next b
endif
for b=1 to tail
setrgb 1,0,255+tail-(b*(255/tail)),0
text x(a),y(a)-(b*12),chr$(z(b,a))
'text x(a),y(a)-(b*12),str$(z(b,a)) rem this displays 0's and 1's
next b
next a
until (1=0)   

Pages: [1] 2 3 4 5 6 7 8 ... 10