'Written In Stone' word puzzle game

User avatar
Dav
Posts: 279
Joined: Tue Dec 30, 2014 5:12 pm
My devices: iPad Mini, iPod Touch.
Location: North Carolina, USA
Contact:

Re: 'Written In Stone' word puzzle game

Post by Dav »

Wow, the launcher app is cool! A lot of neat programs have been posted in my absence.

Here is an install program that will install the game to your device. It just downloads all needed files from my website, then runs the game afterwards. It downloads the Written.txt file instead of the .cod version. It creates a winstone-data folder for the game files.

I've been wanting to make a new version, so if you have any suggestions or advice let me have them please.

- Dav

Code: Select all

'=============================================
'INSTALL WRITTEN IN STONE GAME FOR SMART BASIC
'=============================================
'
'NAME: Winstone-install.txt, v1.01
'Coded by Dav, 1/21/2015
'
'Written In Stone is a word puzzle game.
'It is currently available for smart basic by
'running this install script to download the
'game files from my basic programming website.
'Also, you may download a .ZIP archive of all
'the game files at my website as well. Visit
'the forum for a url to that. 
'
'Enjoy the game.  Let me know how it plays.
'
'
'- Dav
'
'=============================================

option base 1
option screenlock off

'Location of download files (my site)
url$="www.qbasicnews.com/dav/"

print "==========================================="
print " INSTALL Written In Stone v1.1 Game by Dav"
print "==========================================="
print "       (Install v1.01 - 1/21/2015)"
print

if capstr$(device_type$()) <> "IPAD" then
   print "Sorry, this game is only for iPad."
   end
end if

if file_exists("winstone-data/") then goto there

print "This will install the WRITTEN IN STONE game"
print "on your smart Basic device and download all"
print "needed game media files from the internet."
print 
print "A 'winstone-data' folder will be created in"
print "current directory along with 'Winstone.txt'"
print "which is the game program code to run."
print 
print "It will take up about 4MB of data space and"
print "will download from  ";url$
print "You will only have to do the download once."
print "It should only take a couple of minutes."
print
print "Checking internet connection....";

if system_ext_ip$() ="" then
   print "Error!"
   print
   print "You do not appear to be online."
   print "Please connect to the internet and"
   print "try running install again. STOPPED..."
   end
end if

print "OK!"
print
print "MAKE SURE YOU STAY CONNECTED TO THE"
print "INTERNET DURING THE ENTIRE PROCESS."
print

button "install" text "Download & Install" at 70,580
button "later" text "No thanks, maybe later" at 300,580

do
    if button_pressed("later") then 
      text clear
      print "Winstone Install cancelled."
      button "install" delete
      button "later" delete
      end
    end if
    if button_pressed("install") then break
until 0

button "later" delete
button "install" delete

text clear

'==========================================
install:
'=======

'Create folders first..dont overwrite if esists.
text clear
print "Creating folders..."
if file_exists("winstone-data/") = 0  then
   dir "winstone-data/" create
else
   text clear
there:
   print
   print "WARNING NOTICE..."
   print
   print "The winstone-data folder already exists."
   print "The game may already be installed."
   print "To re-install, Delete the winstone-data"
   print "folder and run install again."
   print
   print "Install halted."
   end
end if

if file_exists("winstone-data/fnt2/") = 0 then dir "winstone-data/fnt2" create
if file_exists("winstone-data/img/") = 0 then dir "winstone-data/img/" create
if file_exists("winstone-data/num/") = 0 then dir "winstone-data/num/" create
if file_exists("winstone-data/sfx/") = 0 then dir "winstone-data/sfx/" create
if file_exists("winstone-data/vid/") = 0 then dir "winstone-data/vid/" create


'get list of files to download...

'count files first...
restore to filenames
totalfiles=-1
while a$<>"#"
  read a$ ! totalfiles+=1
end while

'divide in half for real number
'(half of READ was to get filesize)
totalfiles = totalfiles / 2

dim filename$(totalfiles)
dim filesize(totalfiles)

'fill arrays with names and sizes
RESTORE TO filenames
   for g = 1 to totalfiles
   read a$ ! filesize(g) = val(a$)
   read b$ ! filename$(g) = b$
next g

button "stop" text "Stop Downloading" at 100,200

text clear
print "Installing 'Written in Stone' game"
print
print "Downloading file 'Winstone.txt' ";"(? bytes)" 

'first, download "Winstone.txt" file into 
'the cirrent dir
 u$=url$&"Winstone.txt"
 http u$ getdim m
 file "Winstone.txt" writedim m
 text clear

'download the files...
for r = 1 to totalfiles
  text clear
  print "Installing 'Written in Stone' game"
  print
  print "Downloading file ";r;" of ";totalfiles
  print url$;filename$(r);
  print " (";trim$(str$(filesize(r)));" bytes)"

  if system_ext_ip$() ="" then 'check connection..
     goto skip
  else
     'do download here...
     u$=url$&filename$(r)
     http u$ getdim m
     file filename$(r) writedim m
  end if

  if button_pressed("stop") then

skip:

    button "stop" delete
    text clear
    print "Download interrupted!"
    print
    print "Game was not installed."
    print "You must re-download again to install."
    print
    print "An incomplete winstone-data folder created."
    print "Do you want me to delete this folder?"
    button "yes" text "Yes, delete winstone-data folder" at 30, 200
    button "no" text "No, I will take care of it later" at 30, 250
    do
      if button_pressed("yes") then
        dir "winstone-data/" delete
        break
      end if
      if button_pressed("no") then break
    until 0
    button "yes" delete
    button "no" delete
    text clear
    end
  end if

next r

button "stop" delete

text clear
print "Download complete!"
print "Game installed!"
print
print "Run winstone.txt to start the game."
print
print "Would you like to run the game now?"

button "runyes" text "Yes, run Winstone.txt now" at 100,200
button "runno" text "No, I'll run it later" at 100, 300

do
   if button_pressed("runyes") then
     run "Winstone.txt"
     break
   end if
   if button_pressed("runno") then break
until 0

end

'=====================================
filenames:
'=========

'the file sizes are not used in checking
'right now, just for show....

'data "252437","Winstone.COD"
data "1243","Winstone-readme.txt"
data "1121","winstone-data/fnt2/A.jpg"
data "1101","winstone-data/fnt2/B.jpg"
data "1082","winstone-data/fnt2/C.jpg"
data "1094","winstone-data/fnt2/D.jpg"
data "1063","winstone-data/fnt2/E.jpg"
data "1035","winstone-data/fnt2/F.jpg"
data "1112","winstone-data/fnt2/G.jpg"
data "1081","winstone-data/fnt2/H.jpg"
data "1044","winstone-data/fnt2/I.jpg"
data "1044","winstone-data/fnt2/J.jpg"
data "1097","winstone-data/fnt2/K.jpg"
data "996","winstone-data/fnt2/L.jpg"
data "1089","winstone-data/fnt2/M.jpg"
data "1087","winstone-data/fnt2/N.jpg"
data "1118","winstone-data/fnt2/O.jpg"
data "1050","winstone-data/fnt2/P.jpg"
data "1124","winstone-data/fnt2/Q.jpg"
data "1089","winstone-data/fnt2/R.jpg"
data "1117","winstone-data/fnt2/S.jpg"
data "935","winstone-data/fnt2/space.jpg"
data "1029","winstone-data/fnt2/T.jpg"
data "1083","winstone-data/fnt2/U.jpg"
data "1104","winstone-data/fnt2/V.jpg"
data "1091","winstone-data/fnt2/W.jpg"
data "1122","winstone-data/fnt2/X.jpg"
data "1072","winstone-data/fnt2/Y.jpg"
data "1078","winstone-data/fnt2/Z.jpg"
data "1101","winstone-data/fnt2/_A.jpg"
data "1087","winstone-data/fnt2/_B.jpg"
data "1076","winstone-data/fnt2/_C.jpg"
data "1081","winstone-data/fnt2/_D.jpg"
data "1059","winstone-data/fnt2/_E.jpg"
data "1021","winstone-data/fnt2/_F.jpg"
data "1102","winstone-data/fnt2/_G.jpg"
data "1067","winstone-data/fnt2/_H.jpg"
data "1029","winstone-data/fnt2/_I.jpg"
data "1026","winstone-data/fnt2/_J.jpg"
data "1081","winstone-data/fnt2/_K.jpg"
data "982","winstone-data/fnt2/_L.jpg"
data "1069","winstone-data/fnt2/_M.jpg"
data "1074","winstone-data/fnt2/_N.jpg"
data "1108","winstone-data/fnt2/_O.jpg"
data "1031","winstone-data/fnt2/_P.jpg"
data "1114","winstone-data/fnt2/_Q.jpg"
data "1078","winstone-data/fnt2/_R.jpg"
data "1107","winstone-data/fnt2/_S.jpg"
data "1028","winstone-data/fnt2/_T.jpg"
data "1084","winstone-data/fnt2/_U.jpg"
data "1087","winstone-data/fnt2/_V.jpg"
data "1087","winstone-data/fnt2/_W.jpg"
data "1107","winstone-data/fnt2/_X.jpg"
data "1056","winstone-data/fnt2/_Y.jpg"
data "1066","winstone-data/fnt2/_Z.jpg"
data "1544","winstone-data/img/back.jpg"
data "55148","winstone-data/img/board6.jpg"
data "1694","winstone-data/img/config.jpg"
data "193282","winstone-data/img/configscreen2.jpg"
data "1466","winstone-data/img/help.jpg"
data "197422","winstone-data/img/helpscreen.jpg"
data "1389","winstone-data/img/hint.jpg"
data "57764","winstone-data/img/menu_top2.jpg"
data "1284","winstone-data/img/no.jpg"
data "186692","winstone-data/img/paper-timeup.jpg"
data "92639","winstone-data/img/paper-title-left.jpg"
data "92323","winstone-data/img/paper-title-right.jpg"
data "183301","winstone-data/img/paper-title.jpg"
data "10996","winstone-data/img/pop-a-1.jpg"
data "9575","winstone-data/img/pop-a-2.jpg"
data "10025","winstone-data/img/pop-a-3.jpg"
data "7404","winstone-data/img/pop-a-4.jpg"
data "8612","winstone-data/img/pop-a-5.jpg"
data "6395","winstone-data/img/pop-a-6.jpg"
data "7381","winstone-data/img/pop-b-1.jpg"
data "5979","winstone-data/img/pop-b-2.jpg"
data "6606","winstone-data/img/pop-b-3.jpg"
data "7093","winstone-data/img/pop-b-4.jpg"
data "5228","winstone-data/img/pop-b-5.jpg"
data "5863","winstone-data/img/pop-b-6.jpg"
data "5615","winstone-data/img/pop-c-1.jpg"
data "5865","winstone-data/img/pop-c-2.jpg"
data "6980","winstone-data/img/pop-c-3.jpg"
data "5748","winstone-data/img/pop-c-4.jpg"
data "6015","winstone-data/img/pop-c-5.jpg"
data "6585","winstone-data/img/pop-c-6.jpg"
data "6214","winstone-data/img/pop-d-1.jpg"
data "6653","winstone-data/img/pop-d-2.jpg"
data "4651","winstone-data/img/pop-d-3.jpg"
data "6624","winstone-data/img/pop-d-4.jpg"
data "6142","winstone-data/img/pop-d-5.jpg"
data "6878","winstone-data/img/pop-d-6.jpg"
data "6545","winstone-data/img/pop-e-1.jpg"
data "5404","winstone-data/img/pop-e-2.jpg"
data "5027","winstone-data/img/pop-e-3.jpg"
data "6183","winstone-data/img/pop-e-4.jpg"
data "6007","winstone-data/img/pop-e-5.jpg"
data "4484","winstone-data/img/pop-e-6.jpg"
data "5438","winstone-data/img/pop-f-1.jpg"
data "5766","winstone-data/img/pop-f-2.jpg"
data "6131","winstone-data/img/pop-f-3.jpg"
data "6240","winstone-data/img/pop-f-4.jpg"
data "6006","winstone-data/img/pop-f-5.jpg"
data "5659","winstone-data/img/pop-f-6.jpg"
data "5073","winstone-data/img/pop-g-1.jpg"
data "4976","winstone-data/img/pop-g-2.jpg"
data "5959","winstone-data/img/pop-g-3.jpg"
data "6729","winstone-data/img/pop-g-4.jpg"
data "5791","winstone-data/img/pop-g-5.jpg"
data "5928","winstone-data/img/pop-g-6.jpg"
data "6246","winstone-data/img/pop-h-1.jpg"
data "5840","winstone-data/img/pop-h-2.jpg"
data "5831","winstone-data/img/pop-h-3.jpg"
data "6608","winstone-data/img/pop-h-4.jpg"
data "7125","winstone-data/img/pop-h-5.jpg"
data "7437","winstone-data/img/pop-h-6.jpg"
data "4716","winstone-data/img/pop-z-1.jpg"
data "4759","winstone-data/img/pop-z-10.jpg"
data "4976","winstone-data/img/pop-z-11.jpg"
data "4820","winstone-data/img/pop-z-12.jpg"
data "5154","winstone-data/img/pop-z-13.jpg"
data "4941","winstone-data/img/pop-z-14.jpg"
data "4688","winstone-data/img/pop-z-15.jpg"
data "4473","winstone-data/img/pop-z-16.jpg"
data "4816","winstone-data/img/pop-z-2.jpg"
data "5920","winstone-data/img/pop-z-3.jpg"
data "4959","winstone-data/img/pop-z-4.jpg"
data "4629","winstone-data/img/pop-z-5.jpg"
data "5146","winstone-data/img/pop-z-6.jpg"
data "4402","winstone-data/img/pop-z-7.jpg"
data "5366","winstone-data/img/pop-z-8.jpg"
data "4794","winstone-data/img/pop-z-9.jpg"
data "3800","winstone-data/img/popstrip.jpg"
data "1408","winstone-data/img/quitbtn.jpg"
data "1559","winstone-data/img/quote.jpg"
data "2819","winstone-data/img/reset.jpg"
data "18563","winstone-data/img/resetnotice.jpg"
data "7381","winstone-data/img/select-champ.jpg"
data "6383","winstone-data/img/select-msg.jpg"
data "53532","winstone-data/img/select.jpg"
data "919","winstone-data/img/solved.jpg"
data "1583","winstone-data/img/startbtn.jpg"
data "37527","winstone-data/img/timernotice.jpg"
data "664","winstone-data/img/time_grn2.jpg"
data "676","winstone-data/img/time_red2.jpg"
data "661","winstone-data/img/time_yel2.jpg"
data "1941","winstone-data/img/title.jpg"
data "4522","winstone-data/img/wimp.jpg"
data "283761","winstone-data/img/win.jpg"
data "1389","winstone-data/img/yes.jpg"
data "1639","winstone-data/img/_back.jpg"
data "1808","winstone-data/img/_config.jpg"
data "1586","winstone-data/img/_help.jpg"
data "1499","winstone-data/img/_hint.jpg"
data "1405","winstone-data/img/_no.jpg"
data "1538","winstone-data/img/_quitbtn.jpg"
data "1665","winstone-data/img/_quote.jpg"
data "2958","winstone-data/img/_reset.jpg"
data "1725","winstone-data/img/_startbtn.jpg"
data "2037","winstone-data/img/_title.jpg"
data "4757","winstone-data/img/_wimp.jpg"
data "1506","winstone-data/img/_yes.jpg"
data "1048","winstone-data/num/1.jpg"
data "1213","winstone-data/num/10.jpg"
data "1161","winstone-data/num/11.jpg"
data "1216","winstone-data/num/12.jpg"
data "1209","winstone-data/num/13.jpg"
data "1216","winstone-data/num/14.jpg"
data "1204","winstone-data/num/15.jpg"
data "1229","winstone-data/num/16.jpg"
data "1193","winstone-data/num/17.jpg"
data "1232","winstone-data/num/18.jpg"
data "1230","winstone-data/num/19.jpg"
data "1097","winstone-data/num/2.jpg"
data "1248","winstone-data/num/20.jpg"
data "1194","winstone-data/num/21.jpg"
data "1249","winstone-data/num/22.jpg"
data "1247","winstone-data/num/23.jpg"
data "1252","winstone-data/num/24.jpg"
data "1261","winstone-data/num/25.jpg"
data "1270","winstone-data/num/26.jpg"
data "1228","winstone-data/num/27.jpg"
data "1264","winstone-data/num/28.jpg"
data "1262","winstone-data/num/29.jpg"
data "1119","winstone-data/num/3.jpg"
data "1264","winstone-data/num/30.jpg"
data "1214","winstone-data/num/31.jpg"
data "1270","winstone-data/num/32.jpg"
data "1259","winstone-data/num/33.jpg"
data "1248","winstone-data/num/34.jpg"
data "1275","winstone-data/num/35.jpg"
data "1276","winstone-data/num/36.jpg"
data "1234","winstone-data/num/37.jpg"
data "1281","winstone-data/num/38.jpg"
data "1285","winstone-data/num/39.jpg"
data "1082","winstone-data/num/4.jpg"
data "1246","winstone-data/num/40.jpg"
data "1203","winstone-data/num/41.jpg"
data "1245","winstone-data/num/42.jpg"
data "1276","winstone-data/num/43.jpg"
data "1251","winstone-data/num/44.jpg"
data "1272","winstone-data/num/45.jpg"
data "1269","winstone-data/num/46.jpg"
data "1227","winstone-data/num/47.jpg"
data "1271","winstone-data/num/48.jpg"
data "1270","winstone-data/num/49.jpg"
data "1119","winstone-data/num/5.jpg"
data "1275","winstone-data/num/50.jpg"
data "1114","winstone-data/num/6.jpg"
data "1078","winstone-data/num/7.jpg"
data "1129","winstone-data/num/8.jpg"
data "1123","winstone-data/num/9.jpg"
data "43094","winstone-data/sfx/sfx_boom.mp3"
data "59477","winstone-data/sfx/sfx_clap.mp3"
data "10368","winstone-data/sfx/sfx_click.mp3"
data "5960","winstone-data/sfx/sfx_click2.mp3"
data "10158","winstone-data/sfx/sfx_click5.mp3"
data "171699","winstone-data/sfx/sfx_credits.mp3"
data "34736","winstone-data/sfx/sfx_crumble.mp3"
data "12717","winstone-data/sfx/sfx_dropdown.mp3"
data "3858","winstone-data/sfx/sfx_music.mid"
data "4444","winstone-data/sfx/sfx_pop1.mp3"
data "36907","winstone-data/sfx/sfx_roll.mp3"
data "105870","winstone-data/sfx/sfx_rumble.mp3"
data "105870","winstone-data/sfx/sfx_rumble2.mp3"
data "6396","winstone-data/sfx/sfx_select.mp3"
data "13501","winstone-data/sfx/sfx_slideup.mp3"
data "61506","winstone-data/vid/crum0000.jpg"
data "62013","winstone-data/vid/crum0001.jpg"
data "63214","winstone-data/vid/crum0002.jpg"
data "64006","winstone-data/vid/crum0003.jpg"
data "64119","winstone-data/vid/crum0004.jpg"
data "63966","winstone-data/vid/crum0005.jpg"
data "63104","winstone-data/vid/crum0006.jpg"
data "62907","winstone-data/vid/crum0007.jpg"
data "51274","winstone-data/vid/crum0008.jpg"
data "42284","winstone-data/vid/crum0009.jpg"
data "32678","winstone-data/vid/crum0010.jpg"
data "26198","winstone-data/vid/crum0011.jpg"
data "18806","winstone-data/vid/crum0012.jpg"
data "15227","winstone-data/vid/crum0013.jpg"
data "13850","winstone-data/vid/crum0014.jpg"
data "17133","winstone-data/vid/roll0000.jpg"
data "17074","winstone-data/vid/roll0001.jpg"
data "17025","winstone-data/vid/roll0002.jpg"
data "16976","winstone-data/vid/roll0003.jpg"
data "16857","winstone-data/vid/roll0004.jpg"
data "16631","winstone-data/vid/roll0005.jpg"
data "25927","winstone-data/vid/sel0000.jpg"
data "23638","winstone-data/vid/sel0001.jpg"
data "20104","winstone-data/vid/sel0002.jpg"
data "17789","winstone-data/vid/sel0003.jpg"
data "15694","winstone-data/vid/sel0004.jpg"
data "13662","winstone-data/vid/sel0005.jpg"
data "12329","winstone-data/vid/sel0006.jpg"
data "11103","winstone-data/vid/sel0007.jpg"
data "10106","winstone-data/vid/sel0008.jpg"
data "9163","winstone-data/vid/sel0009.jpg"
data "8398","winstone-data/vid/sel0010.jpg"
data "7631","winstone-data/vid/sel0011.jpg"
data "7111","winstone-data/vid/sel0012.jpg"
data "6553","winstone-data/vid/sel0013.jpg"
data "5980","winstone-data/vid/sel0014.jpg"
data "4875","winstone-data/vid/sel0015.jpg"
data "#"

User avatar
rbytes
Posts: 1338
Joined: Sun May 31, 2015 12:11 am
My devices: iPhone 11 Pro Max
iPad Pro 11
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet
Location: Calgary, Canada
Flag: Canada
Contact:

Re: 'Written In Stone' word puzzle game

Post by rbytes »

Thanks, Dav. You did a professional job on Written in Stone. I like the animations and sound.

I was away on holidays for a month this summer at an RV park that didn't have very reliable wifi, but I managed to post a few things. Sometimes it took more than one try.
The only thing that gets me down is gravity...

User avatar
Dav
Posts: 279
Joined: Tue Dec 30, 2014 5:12 pm
My devices: iPad Mini, iPod Touch.
Location: North Carolina, USA
Contact:

Re: 'Written In Stone' word puzzle game

Post by Dav »

I have updated this puzzle game. After getting a new iPad I discovered the animation and sound didn't go together well on a faster device, so I fixed that problem. It now plays the same on both old and newer ipads. I also fixed a quote error. Here is the updated code attached. All you have to do is replace the Written.txt source with this new one.

Note: You have to install the game first to run this source code.

- Dav
Attachments
Winstone.txt
(81.47 KiB) Downloaded 357 times

User avatar
rbytes
Posts: 1338
Joined: Sun May 31, 2015 12:11 am
My devices: iPhone 11 Pro Max
iPad Pro 11
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet
Location: Calgary, Canada
Flag: Canada
Contact:

Re: 'Written In Stone' word puzzle game

Post by rbytes »

Thanks, Dav. This is a great game. I have updated my version.
The only thing that gets me down is gravity...

Henko
Posts: 814
Joined: Tue Apr 09, 2013 12:23 pm
My devices: iPhone,iPad
Windows
Location: Groningen, Netherlands
Flag: Netherlands

Re: 'Written In Stone' word puzzle game

Post by Henko »

I like the idea of this puzzle, and couldn't resist to make my own version. It's a "bare bones" program, but takes texts of any length. I will use it to handle Dutch quotes. Thanks to Dav for introducing it here.

Code: Select all

option base 1 ! randomize ! graphics ! graphics clear
dim word$(99),wlen(99),tok_org$(10,20),tok$(10,20)
ncol=20 ! size=30
sen$=get_sentence$() ! split sen$ to word$,nw with " "
nrow=count() ! def_boxes(nrow,ncol) ! bottom=50+nrow*(size+10)
fill_array() ! mix_columns() ! fill_buttons(0)
button "stop"  text "Stop"  at 400,bottom size 100,50
button "solve" text "Solve" at 280,bottom size 100,50
button "turn"  text "first one..." at 35,bottom size 150,50
do 
  get_letter(1)     '********  returns r1 and c1
  get_letter(2)     '********  returns r2 and c2
  save$=tok$(r1,c1) ! tok$(r1,c1)=tok$(r2,c2) ! tok$(r2,c2)=save$
  button "b"&r1&c1 text tok$(r1,c1) ! button "b"&r2&c2 text tok$(r2,c2)
  until forever
end

def get_sentence$()   '******* get text for the puzzle
                      '******* insert your own method here
input "type a wisdom, or press enter for default :":s$
if s$="" then s$="This is a test sentence for a word game which was converted from Qbasic by Dav."
return s$
end def

def count()     '********** calculate number of lines
nr=1 ! rp=-1
for i=1 to .nw
  lw=len(.word$(i)) ! .wlen(i)=lw
  if rp+lw+1>.ncol then ! nr+=1 ! rp=-1 ! end if  ' new line
  rp+=lw+1                                        ' add word to lin
  next i
return nr
end def

def def_boxes(nr,nc)    '********** define nrow x ncol buttons
for i=1 to nr ! for j=1 to nc
name$="b"&i&j
button name$ text "" at j*(.size+5),i*(.size+10) size .size,.size
next j ! next i
end def

def fill_array()  '******* place the text in the array
nr=1 ! rp=1
for i=1 to .nw
  lw=.wlen(i) ! if rp+lw-1>.ncol then ! nr+=1 ! rp=1 ! end if
  for k=1 to lw ! .tok_org$(nr,rp)=mid$(.word$(i),k,1) ! rp+=1 ! next k
  if rp<.ncol then rp+=1
  next i
end def

def mix_columns()    '********* shuffle the letters in each column
dim ind(.nrow)
for c=1 to .ncol
  for i=1 to .nrow ! ind(i)=0 ! next i
  for i=1 to .nrow
    do ! ran=1+rnd(.nrow) ! until ind(ran)=0
    ind(ran)=1 ! .tok$(i,c)=.tok_org$(ran,c)
    next i
  next c
end def

def fill_buttons(ind)     '********** place the text in the buttons
for i=1 to .nrow ! for j=1 to .ncol
  if ind=0 then t$=.tok$(i,j) else t$=.tok_org$(i,j)
  name$="b"&i&j ! button name$ text t$
  next j ! next i
end def
 
def get_letter(ind)
do slowdown
  for i=1 to .nrow ! for j=1 to .ncol
    name$="b"&i&j ! if button_pressed(name$) then go_on
    next j ! next i
  if button_pressed("solve") then fill_buttons(1)
  if button_pressed("stop") then stop
  until forever
go_on:
if ind=1 then ! .r1=i ! .c1=j ! t$="second one..."
         else ! .r2=i ! .c2=j ! t$="first one..."
  end if
button "turn" text t$
return
end def
IMG_1415.PNG
IMG_1415.PNG (322.03 KiB) Viewed 4441 times
IMG_1416.PNG
IMG_1416.PNG (322.93 KiB) Viewed 4441 times

User avatar
Dav
Posts: 279
Joined: Tue Dec 30, 2014 5:12 pm
My devices: iPad Mini, iPod Touch.
Location: North Carolina, USA
Contact:

Re: 'Written In Stone' word puzzle game

Post by Dav »

NIce code, Henko! Works fine for me here!

- Dav

User avatar
rbytes
Posts: 1338
Joined: Sun May 31, 2015 12:11 am
My devices: iPhone 11 Pro Max
iPad Pro 11
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet
Location: Calgary, Canada
Flag: Canada
Contact:

Re: 'Written In Stone' word puzzle game

Post by rbytes »

Works well for me too. But you should make the Solve button less sensitive. It seems I push it before I should! :lol:
The only thing that gets me down is gravity...

Post Reply