home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / hc2_x / tongubng.sea / TongueBingo / background_3297.txt < prev    next >
Text File  |  1991-08-27  |  10KB  |  415 lines

  1. -- background: 3297 from stack: in
  2. -- bmap block id: 6819
  3. -- flags: 4000
  4. -- background id: 0
  5. -- name: Bingo
  6. ----- HyperTalk script -----
  7. on mouseUp
  8.   global oikeat, oikea, oikeita, v├ñ├ñri├ñ, valinta, ├ñ├ñni, kohtelias, alku, kesto, osattu
  9.   put the ticks into nyt
  10.   if "field" is in the target then
  11.     add nyt-alku to kesto
  12.     put number of the target into valinta
  13.     if valinta is oikea then
  14.       if ├ñ├ñni then play "Beethoven5" else select text of the target
  15.       set textStyle of field valinta to bold,italic,underline
  16.       put true into item valinta of oikeat
  17.       put field 17&&" " after osattu
  18.       add 1 to oikeita
  19.       bingoko
  20.     else     -- wrong answer
  21.       if kohtelias then play "oops" else play "Lamb"
  22.       select text of field oikea
  23.       answer "'"&field 17&"' should've been:"&&field oikea with "Of course"
  24.       add 600 to kesto  -- 10 sec penalty
  25.       add 1 to v├ñ├ñri├ñ
  26.       uusisana
  27.     end if -- valinta
  28.   end if -- "field"
  29. end mouseUp
  30.  
  31. on uusiSana
  32.   global lukum, mist├ñ,mihin, oikeat, oikea, alku, osattu
  33.   put "Moment please, doing next assignmentΓǪ"
  34.   set lockScreen to true
  35.   put random(16) into oikea -- sanan sijoituspaikka ruudukossa
  36.   put random(lukum) into vastaus -- monesko rivi
  37.   repeat while line vastaus in mist├ñ is in osattu -- ei samoja uudestaan
  38.     put random(lukum) into vastaus
  39.   end repeat
  40.   put line vastaus in mist├ñ into field 17 -- kysytty sana
  41.   put vastaus into varatut
  42.   repeat with sana = 1 to 16
  43.     if sana=oikea then
  44.       put line vastaus in mihin into field sana
  45.     else  -- muut vaihtoehdot
  46.       put random(lukum) into mones
  47.       repeat while mones is in varatut -- ei samoja moneen kertaan
  48.         put random(lukum) into mones
  49.       end repeat
  50.       put " "&mones after varatut
  51.       put line mones in mihin into field sana
  52.     end if
  53.   end repeat -- sana
  54.   hide message
  55.   set lockScreen to false
  56.   flash 1 -- XCMD
  57.   put the ticks into alku
  58.   flushEvents
  59. end uusiSana
  60.  
  61. on bingoko
  62.   global valinta, kieli
  63.   put false into bingo
  64.   put (valinta-1) div 4 into rivi
  65.   put valinta - rivi*4 into sara
  66.   put on4(valinta-sara+1,1) into bingo -- vaakaan?
  67.   if on4(sara,4) then put true into bingo -- pystyyn?
  68.   add 1 to rivi
  69.   if rivi=sara then if on4(1,5) then put true into bingo -- kenoon?
  70.   if rivi+sara=5 then if on4(4,3) then put true into bingo -- vinoon?
  71.   if bingo then
  72.     visual effect barn door open
  73.     push card
  74.     go to card kieli of background "Tulos" -- kukin kieli erikseen!
  75.   else
  76.     uusisana
  77.   end if
  78. end bingoko
  79.  
  80. function on4 alku, lis├ñys
  81. global oikeat, kohtelias
  82. put 0 into lkm
  83. put alku into kohta
  84. repeat for 4 times
  85.   if item kohta of oikeat=true then add 1 to lkm else exit repeat
  86.   add lis├ñys to kohta
  87. end repeat
  88. if lkm=4 then   -- vilkuta bingo
  89.   play "Hallelujah"
  90.   if kohtelias then wait 134 else play "PWscream"
  91.   play "Hallelujah"
  92.   put alku into kohta
  93.   repeat for 4 times
  94.     select text of field kohta
  95.     set textStyle of field kohta to outline,underline,shadow
  96.     wait 15 -- jotta valinta ehtii n├ñky├ñ
  97.     add lis├ñys to kohta
  98.   end repeat
  99. end if
  100. return lkm=4
  101. end on4
  102.  
  103.  
  104.  
  105. -- part 1 (field)
  106. -- low flags: 01
  107. -- high flags: 0002
  108. -- rect: left=5 top=66 right=128 bottom=131
  109. -- title width / last selected line: 0
  110. -- icon id / first selected line: 0 / 0
  111. -- text alignment: 1
  112. -- font id: 21
  113. -- text size: 14
  114. -- style flags: 256
  115. -- line height: 18
  116. -- part name: 1
  117.  
  118.  
  119. -- part 4 (field)
  120. -- low flags: 01
  121. -- high flags: 0002
  122. -- rect: left=131 top=66 right=128 bottom=257
  123. -- title width / last selected line: 0
  124. -- icon id / first selected line: 0 / 0
  125. -- text alignment: 1
  126. -- font id: 21
  127. -- text size: 14
  128. -- style flags: 256
  129. -- line height: 18
  130. -- part name: 2
  131.  
  132.  
  133. -- part 5 (field)
  134. -- low flags: 01
  135. -- high flags: 0002
  136. -- rect: left=257 top=66 right=128 bottom=383
  137. -- title width / last selected line: 0
  138. -- icon id / first selected line: 0 / 0
  139. -- text alignment: 1
  140. -- font id: 21
  141. -- text size: 14
  142. -- style flags: 256
  143. -- line height: 18
  144. -- part name: 3
  145.  
  146.  
  147. -- part 6 (field)
  148. -- low flags: 01
  149. -- high flags: 0002
  150. -- rect: left=383 top=66 right=128 bottom=509
  151. -- title width / last selected line: 0
  152. -- icon id / first selected line: 0 / 0
  153. -- text alignment: 1
  154. -- font id: 21
  155. -- text size: 14
  156. -- style flags: 256
  157. -- line height: 18
  158. -- part name: 4
  159.  
  160.  
  161. -- part 8 (field)
  162. -- low flags: 01
  163. -- high flags: 0002
  164. -- rect: left=5 top=128 right=190 bottom=131
  165. -- title width / last selected line: 0
  166. -- icon id / first selected line: 0 / 0
  167. -- text alignment: 1
  168. -- font id: 21
  169. -- text size: 14
  170. -- style flags: 256
  171. -- line height: 18
  172. -- part name: 5
  173.  
  174.  
  175. -- part 9 (field)
  176. -- low flags: 01
  177. -- high flags: 0002
  178. -- rect: left=131 top=128 right=190 bottom=257
  179. -- title width / last selected line: 0
  180. -- icon id / first selected line: 0 / 0
  181. -- text alignment: 1
  182. -- font id: 21
  183. -- text size: 14
  184. -- style flags: 256
  185. -- line height: 18
  186. -- part name: 6
  187.  
  188.  
  189. -- part 10 (field)
  190. -- low flags: 01
  191. -- high flags: 0002
  192. -- rect: left=257 top=128 right=190 bottom=383
  193. -- title width / last selected line: 0
  194. -- icon id / first selected line: 0 / 0
  195. -- text alignment: 1
  196. -- font id: 21
  197. -- text size: 14
  198. -- style flags: 256
  199. -- line height: 18
  200. -- part name: 
  201.  
  202.  
  203. -- part 12 (field)
  204. -- low flags: 01
  205. -- high flags: 0002
  206. -- rect: left=383 top=128 right=190 bottom=509
  207. -- title width / last selected line: 0
  208. -- icon id / first selected line: 0 / 0
  209. -- text alignment: 1
  210. -- font id: 21
  211. -- text size: 14
  212. -- style flags: 256
  213. -- line height: 18
  214. -- part name: 
  215.  
  216.  
  217. -- part 13 (field)
  218. -- low flags: 01
  219. -- high flags: 0002
  220. -- rect: left=5 top=190 right=252 bottom=131
  221. -- title width / last selected line: 0
  222. -- icon id / first selected line: 0 / 0
  223. -- text alignment: 1
  224. -- font id: 21
  225. -- text size: 14
  226. -- style flags: 256
  227. -- line height: 18
  228. -- part name: 
  229.  
  230.  
  231. -- part 14 (field)
  232. -- low flags: 01
  233. -- high flags: 0002
  234. -- rect: left=131 top=190 right=252 bottom=257
  235. -- title width / last selected line: 0
  236. -- icon id / first selected line: 0 / 0
  237. -- text alignment: 1
  238. -- font id: 21
  239. -- text size: 14
  240. -- style flags: 256
  241. -- line height: 18
  242. -- part name: 
  243.  
  244.  
  245. -- part 15 (field)
  246. -- low flags: 01
  247. -- high flags: 0002
  248. -- rect: left=257 top=190 right=252 bottom=383
  249. -- title width / last selected line: 0
  250. -- icon id / first selected line: 0 / 0
  251. -- text alignment: 1
  252. -- font id: 21
  253. -- text size: 14
  254. -- style flags: 256
  255. -- line height: 18
  256. -- part name: 
  257.  
  258.  
  259. -- part 16 (field)
  260. -- low flags: 01
  261. -- high flags: 0002
  262. -- rect: left=383 top=190 right=252 bottom=509
  263. -- title width / last selected line: 0
  264. -- icon id / first selected line: 0 / 0
  265. -- text alignment: 1
  266. -- font id: 21
  267. -- text size: 14
  268. -- style flags: 256
  269. -- line height: 18
  270. -- part name: 
  271.  
  272.  
  273. -- part 17 (field)
  274. -- low flags: 01
  275. -- high flags: 0002
  276. -- rect: left=5 top=252 right=314 bottom=131
  277. -- title width / last selected line: 0
  278. -- icon id / first selected line: 0 / 0
  279. -- text alignment: 1
  280. -- font id: 21
  281. -- text size: 14
  282. -- style flags: 256
  283. -- line height: 18
  284. -- part name: 
  285.  
  286.  
  287. -- part 18 (field)
  288. -- low flags: 01
  289. -- high flags: 0002
  290. -- rect: left=131 top=252 right=314 bottom=257
  291. -- title width / last selected line: 0
  292. -- icon id / first selected line: 0 / 0
  293. -- text alignment: 1
  294. -- font id: 21
  295. -- text size: 14
  296. -- style flags: 256
  297. -- line height: 18
  298. -- part name: 
  299.  
  300.  
  301. -- part 19 (field)
  302. -- low flags: 01
  303. -- high flags: 0002
  304. -- rect: left=257 top=252 right=314 bottom=383
  305. -- title width / last selected line: 0
  306. -- icon id / first selected line: 0 / 0
  307. -- text alignment: 1
  308. -- font id: 21
  309. -- text size: 14
  310. -- style flags: 256
  311. -- line height: 18
  312. -- part name: 
  313.  
  314.  
  315. -- part 20 (field)
  316. -- low flags: 01
  317. -- high flags: 0002
  318. -- rect: left=383 top=252 right=314 bottom=509
  319. -- title width / last selected line: 0
  320. -- icon id / first selected line: 0 / 0
  321. -- text alignment: 1
  322. -- font id: 21
  323. -- text size: 14
  324. -- style flags: 256
  325. -- line height: 18
  326. -- part name: 
  327.  
  328.  
  329. -- part 21 (field)
  330. -- low flags: 01
  331. -- high flags: 0004
  332. -- rect: left=8 top=26 right=58 bottom=348
  333. -- title width / last selected line: 0
  334. -- icon id / first selected line: 0 / 0
  335. -- text alignment: 1
  336. -- font id: 7
  337. -- text size: 18
  338. -- style flags: 0
  339. -- line height: 24
  340. -- part name: Sana
  341.  
  342.  
  343. -- part 22 (button)
  344. -- low flags: 00
  345. -- high flags: E005
  346. -- rect: left=375 top=21 right=37 bottom=458
  347. -- title width / last selected line: 0
  348. -- icon id / first selected line: 0 / 0
  349. -- text alignment: 1
  350. -- font id: 0
  351. -- text size: 12
  352. -- style flags: 0
  353. -- line height: 16
  354. -- part name: Fanfare
  355. ----- HyperTalk script -----
  356. on mouseUp
  357.   global ├ñ├ñni
  358.   put not ├ñ├ñni into ├ñ├ñni
  359. end mouseUp
  360.  
  361.  
  362. -- part 23 (button)
  363. -- low flags: 00
  364. -- high flags: A003
  365. -- rect: left=17 top=318 right=338 bottom=108
  366. -- title width / last selected line: 0
  367. -- icon id / first selected line: 0 / 0
  368. -- text alignment: 1
  369. -- font id: 0
  370. -- text size: 12
  371. -- style flags: 0
  372. -- line height: 16
  373. -- part name: Grid Size
  374. ----- HyperTalk script -----
  375. on mouseUp -- 512x342
  376.   ask "Enter Grid Size in Points: margin, gap" with "10,1"
  377.   if it is empty then exit mouseUp
  378.   put item 1 of it into reunus
  379.   put item 2 of it into v├ñli
  380.   put round((513-2*reunus - 3*v├ñli)/4) into leveys
  381.   put 66 into yl├ñ
  382.   put the top of button "Back to Glossary" -2 into ala -- 328
  383.   put round((ala-yl├ñ - 3*v├ñli)/4) into korkeus
  384.   put leveys&&korkeus
  385.   put reunus into vasen
  386.   repeat with box=1 to 16
  387.     set the rect of field box to vasen,yl├ñ,vasen+leveys,yl├ñ+korkeus
  388.     add leveys+v├ñli to vasen
  389.     if box mod 4 = 0 then -- rivin vaihto
  390.       put reunus into vasen
  391.       add korkeus+v├ñli to yl├ñ
  392.     end if
  393.   end repeat
  394.   hide message
  395. end mouseUp
  396.  
  397.  
  398. -- part 25 (button)
  399. -- low flags: 00
  400. -- high flags: A005
  401. -- rect: left=375 top=3 right=20 bottom=463
  402. -- title width / last selected line: 0
  403. -- icon id / first selected line: 0 / 0
  404. -- text alignment: 1
  405. -- font id: 0
  406. -- text size: 12
  407. -- style flags: 0
  408. -- line height: 16
  409. -- part name: Courteous
  410. ----- HyperTalk script -----
  411. on mouseUp
  412.   global kohtelias
  413.   put not kohtelias into kohtelias
  414. end mouseUp
  415.