Author Topic: Puzzle Helper  (Read 1094 times)

0 Members and 1 Guest are viewing this topic.

Offline bikemadness

  • Amiga 1200
  • ****
  • Posts: 312
  • Karma: 25
  • Hard players don't go home.
    • View Profile
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

Have a Yahappy day.
I don't know what is wrong with the world - but I know how to fix it.