-- background: 3297 from stack: in -- bmap block id: 6819 -- flags: 4000 -- background id: 0 -- name: Bingo ----- HyperTalk script ----- on mouseUp global oikeat, oikea, oikeita, vääriä, valinta, ääni, kohtelias, alku, kesto, osattu put the ticks into nyt if "field" is in the target then add nyt-alku to kesto put number of the target into valinta if valinta is oikea then if ääni then play "Beethoven5" else select text of the target set textStyle of field valinta to bold,italic,underline put true into item valinta of oikeat put field 17&&" " after osattu add 1 to oikeita bingoko else -- wrong answer if kohtelias then play "oops" else play "Lamb" select text of field oikea answer "'"&field 17&"' should've been:"&&field oikea with "Of course" add 600 to kesto -- 10 sec penalty add 1 to vääriä uusisana end if -- valinta end if -- "field" end mouseUp on uusiSana global lukum, mistä,mihin, oikeat, oikea, alku, osattu put "Moment please, doing next assignment…" set lockScreen to true put random(16) into oikea -- sanan sijoituspaikka ruudukossa put random(lukum) into vastaus -- monesko rivi repeat while line vastaus in mistä is in osattu -- ei samoja uudestaan put random(lukum) into vastaus end repeat put line vastaus in mistä into field 17 -- kysytty sana put vastaus into varatut repeat with sana = 1 to 16 if sana=oikea then put line vastaus in mihin into field sana else -- muut vaihtoehdot put random(lukum) into mones repeat while mones is in varatut -- ei samoja moneen kertaan put random(lukum) into mones end repeat put " "&mones after varatut put line mones in mihin into field sana end if end repeat -- sana hide message set lockScreen to false flash 1 -- XCMD put the ticks into alku flushEvents end uusiSana on bingoko global valinta, kieli put false into bingo put (valinta-1) div 4 into rivi put valinta - rivi*4 into sara put on4(valinta-sara+1,1) into bingo -- vaakaan? if on4(sara,4) then put true into bingo -- pystyyn? add 1 to rivi if rivi=sara then if on4(1,5) then put true into bingo -- kenoon? if rivi+sara=5 then if on4(4,3) then put true into bingo -- vinoon? if bingo then visual effect barn door open push card go to card kieli of background "Tulos" -- kukin kieli erikseen! else uusisana end if end bingoko function on4 alku, lisäys global oikeat, kohtelias put 0 into lkm put alku into kohta repeat for 4 times if item kohta of oikeat=true then add 1 to lkm else exit repeat add lisäys to kohta end repeat if lkm=4 then -- vilkuta bingo play "Hallelujah" if kohtelias then wait 134 else play "PWscream" play "Hallelujah" put alku into kohta repeat for 4 times select text of field kohta set textStyle of field kohta to outline,underline,shadow wait 15 -- jotta valinta ehtii näkyä add lisäys to kohta end repeat end if return lkm=4 end on4 -- part 1 (field) -- low flags: 01 -- high flags: 0002 -- rect: left=5 top=66 right=128 bottom=131 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 21 -- text size: 14 -- style flags: 256 -- line height: 18 -- part name: 1 -- part 4 (field) -- low flags: 01 -- high flags: 0002 -- rect: left=131 top=66 right=128 bottom=257 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 21 -- text size: 14 -- style flags: 256 -- line height: 18 -- part name: 2 -- part 5 (field) -- low flags: 01 -- high flags: 0002 -- rect: left=257 top=66 right=128 bottom=383 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 21 -- text size: 14 -- style flags: 256 -- line height: 18 -- part name: 3 -- part 6 (field) -- low flags: 01 -- high flags: 0002 -- rect: left=383 top=66 right=128 bottom=509 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 21 -- text size: 14 -- style flags: 256 -- line height: 18 -- part name: 4 -- part 8 (field) -- low flags: 01 -- high flags: 0002 -- rect: left=5 top=128 right=190 bottom=131 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 21 -- text size: 14 -- style flags: 256 -- line height: 18 -- part name: 5 -- part 9 (field) -- low flags: 01 -- high flags: 0002 -- rect: left=131 top=128 right=190 bottom=257 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 21 -- text size: 14 -- style flags: 256 -- line height: 18 -- part name: 6 -- part 10 (field) -- low flags: 01 -- high flags: 0002 -- rect: left=257 top=128 right=190 bottom=383 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 21 -- text size: 14 -- style flags: 256 -- line height: 18 -- part name: -- part 12 (field) -- low flags: 01 -- high flags: 0002 -- rect: left=383 top=128 right=190 bottom=509 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 21 -- text size: 14 -- style flags: 256 -- line height: 18 -- part name: -- part 13 (field) -- low flags: 01 -- high flags: 0002 -- rect: left=5 top=190 right=252 bottom=131 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 21 -- text size: 14 -- style flags: 256 -- line height: 18 -- part name: -- part 14 (field) -- low flags: 01 -- high flags: 0002 -- rect: left=131 top=190 right=252 bottom=257 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 21 -- text size: 14 -- style flags: 256 -- line height: 18 -- part name: -- part 15 (field) -- low flags: 01 -- high flags: 0002 -- rect: left=257 top=190 right=252 bottom=383 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 21 -- text size: 14 -- style flags: 256 -- line height: 18 -- part name: -- part 16 (field) -- low flags: 01 -- high flags: 0002 -- rect: left=383 top=190 right=252 bottom=509 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 21 -- text size: 14 -- style flags: 256 -- line height: 18 -- part name: -- part 17 (field) -- low flags: 01 -- high flags: 0002 -- rect: left=5 top=252 right=314 bottom=131 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 21 -- text size: 14 -- style flags: 256 -- line height: 18 -- part name: -- part 18 (field) -- low flags: 01 -- high flags: 0002 -- rect: left=131 top=252 right=314 bottom=257 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 21 -- text size: 14 -- style flags: 256 -- line height: 18 -- part name: -- part 19 (field) -- low flags: 01 -- high flags: 0002 -- rect: left=257 top=252 right=314 bottom=383 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 21 -- text size: 14 -- style flags: 256 -- line height: 18 -- part name: -- part 20 (field) -- low flags: 01 -- high flags: 0002 -- rect: left=383 top=252 right=314 bottom=509 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 21 -- text size: 14 -- style flags: 256 -- line height: 18 -- part name: -- part 21 (field) -- low flags: 01 -- high flags: 0004 -- rect: left=8 top=26 right=58 bottom=348 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 7 -- text size: 18 -- style flags: 0 -- line height: 24 -- part name: Sana -- part 22 (button) -- low flags: 00 -- high flags: E005 -- rect: left=375 top=21 right=37 bottom=458 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Fanfare ----- HyperTalk script ----- on mouseUp global ääni put not ääni into ääni end mouseUp -- part 23 (button) -- low flags: 00 -- high flags: A003 -- rect: left=17 top=318 right=338 bottom=108 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Grid Size ----- HyperTalk script ----- on mouseUp -- 512x342 ask "Enter Grid Size in Points: margin, gap" with "10,1" if it is empty then exit mouseUp put item 1 of it into reunus put item 2 of it into väli put round((513-2*reunus - 3*väli)/4) into leveys put 66 into ylä put the top of button "Back to Glossary" -2 into ala -- 328 put round((ala-ylä - 3*väli)/4) into korkeus put leveys&&korkeus put reunus into vasen repeat with box=1 to 16 set the rect of field box to vasen,ylä,vasen+leveys,ylä+korkeus add leveys+väli to vasen if box mod 4 = 0 then -- rivin vaihto put reunus into vasen add korkeus+väli to ylä end if end repeat hide message end mouseUp -- part 25 (button) -- low flags: 00 -- high flags: A005 -- rect: left=375 top=3 right=20 bottom=463 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Courteous ----- HyperTalk script ----- on mouseUp global kohtelias put not kohtelias into kohtelias end mouseUp