on Opencard 1
disable menu "Option"
disable menu "Index"
ExplanationMenuName help
put 0 into firstonlyonetime
wait 90 ticks
play organch1
wait 210 ticks

play creak
dooropen
wait 60 ticks
play horror1
wait 300 ticks
go cd 16
end opencard


On opencard 16


put 10 into w1x
play miyako1
witchanime1
wait 90 ticks

play muon

put 5 into w1x
play miyako2
witchanime1
wait 90 ticks

play muon
go cd 3
End OpenCard


on Opencard 100
go card 3
End Opencard

on dooropen
set bitmap of btn door1 to door2
wait 20 ticks
set bitmap of btn door1 to door3
wait 20 ticks
end dooropen
-------------------card3------------------------
On notabletogo
End notabletogo

On set_gradel
play switchb

 set bitmap of btn gradel to gradels
 set bitmap of btn gradem to gradem
 set bitmap of btn gradeh to gradeh
 put 0 into grade_level
End set_gradel

On set_gradem
play switchb

 set bitmap of btn gradel to gradel
 set bitmap of btn gradem to gradems
 set bitmap of btn gradeh to gradeh
 put 1 into grade_level
End set_gradem

On set_gradeh
play switchb

 set bitmap of btn gradel to gradel
 set bitmap of btn gradem to gradem
 set bitmap of btn gradeh to gradehs
 put 2 into grade_level
End set_gradeh





On initialize
put 0 into frogloc
put 2 into step1_1
put 36 into step1_2
put 3 into step2_1
put 1 into step2_2
put 0 into step2_egg
put 4 into step3_1
put 19 into step3_2
put 2 into step3_3
put 20 into step3_4
put 5 into step4_1
put 3 into step4_2
put 6 into step5_1
put 4 into step5_2
put 0 into step5_egg
put 7 into step6_1
put 5 into step6_2
put 8 into step7_1
put 6 into step7_2
put 28 into step7_3
put 29 into step7_4
put 9 into step8_1
put 7 into step8_2
put 0 into step8_egg
put 10 into step9_1
put 8 into step9_2
put 11 into step10_1
put 9 into step10_2
put 12 into step11_1
put 10 into step11_2
put 32 into step11_3
put 24 into step11_4
put 33 into step11_5
put 25 into step11_6
put 13 into step12_1
put 11 into step12_2
put 14 into step13_1
put 12 into step13_2
put 15 into step14_1
put 13 into step14_2
put 0 into step14_egg
put 999 into step15_1
put 14 into step15_2
put 17 into step16_1
put 36 into step16_2
put 37 into step16_3
put 18 into step17_1
put 16 into step17_2
put 19 into step18_1
put 17 into step18_2
put 0 into step18_egg
put 3 into step19_1
put 18 into step19_2
put 21 into step20_1
put 3 into step20_2
put 22 into step21_1
put 20 into step21_2
put 0 into step21_egg
put 23 into step22_1
put 21 into step22_2
put 0 into step22_egg
put 24 into step23_1
put 22 into step23_2
put 0 into step23_egg
put 11 into step24_1
put 23 into step24_2
put 26 into step25_1
put 11 into step25_2
put 0 into step25_egg
put 999 into step26_1
put 25 into step26_2
put 0 into step26_egg
put 28 into step27_1
put 37 into step27_2
put 7 into step28_1
put 27 into step28_2
put 0 into step28_egg
put 30 into step29_1
put 7 into step29_2
put 31 into step30_1
put 29 into step30_2
put 32 into step31_1
put 30 into step31_2
put 0 into step31_egg
put 11 into step32_1
put 31 into step32_2
put 0 into step32_egg
put 34 into step33_1
put 11 into step33_2
put 35 into step34_1
put 33 into step34_2
put 0 into step34_egg
put 999 into step35_1
put 34 into step35_2
put 1 into step36_1
put 16 into step36_2
put 37 into step36_3
put 27 into step37_1
put 16 into step37_2
put 36 into step37_3
put 18000 into final_time
put 720 into limit_time
put 1 into correct_ans
put 1 into math_answer
put 600 into math_time
--------------------------------------------------
put 0 into step38_egg
put 0 into step39_egg
put 0 into step41_egg
put 0 into step42_egg
put 1 into step43_egg
put 1 into step44_egg
put 0 into step45_egg
put 0 into step46_egg
put 0 into step47_egg
put 0 into step49_egg
put 0 into step50_egg
put 0 into step51_egg
---------------------------------
put 2 into eggnumber
put 0 into crackedegg
put 50 into maxcrackedegg
put 8 into maxeggnumber
-----------------------------
put 0 into zone1
put 0 into zone2
put 0 into zone3
put 0 into zone4
put 0 into zone5
put 0 into zone6
put 0 into zone7
put 0 into zone8
-----------------------
put 0 into dragontimeup
put 0 into selectedzone
put 0 into clicked
put 0 into game_on
set bitmap of btn witch1 to witch1
repeat with xxx = 1 to 101
 put 0 into Item xxx of xquiztbl
end repeat
put 0 into quizongoing





End initialize

On finalize
wait 10 ticks
End finalize

On clickfrogbutton
  click at clickh(), clickv()
end clickfrogbutton


On witchanime1
repeat w1x times

set bitmap of btn witchl1 to witchl2
if random(10) = 1 then
   wait 3 ticks
else 
   wait 5 ticks
end if
set bitmap of btn witchl1 to witchl1
if random(25) = 8 then
   wait 8 ticks
else
wait 5 ticks

end if
set bitmap of btn witchl1 to witchl3
if random(30) = 1 then
   wait 10 ticks
else
wait 5 ticks

end if

set bitmap of btn witchl1 to witchl1
wait 5 ticks
set bitmap of btn witchl1 to witchl2
wait 5 ticks
if random(20) = 8 then
   wait 7 ticks
end if
set bitmap of btn witchl1 to witchl1
wait 5 ticks
end repeat
End witchanime1




On witchanime2
repeat with j = 1 to 4
if mouseclick() then
  exit witchanime2
end if
set bitmap of btn witch1 to witch2
wait 6 ticks
if random(15) = 8 then
  wait 15 ticks
end if
set bitmap of btn witch1 to witch1
wait 6 ticks
set bitmap of btn witch1 to witch3
wait 6 ticks
if random(15) = 8 then
  wait 15 ticks
end if
set bitmap of btn witch1 to witch1
wait 6 ticks
if mouseclick() then
  exit witchanime2
end if
set bitmap of btn witch1 to witch2
wait 6 ticks
if random(15) = 8 then
  wait 15 ticks
end if
set bitmap of btn witch1 to witch1
wait 6 ticks
end repeat
End witchanime2


On witchanime3
repeat with j = 1 to w3x
if mouseclick() then
  exit witchanime3
end if
set bitmap of btn witch1 to witch2
wait 10 ticks
if mouseclick() then
   put 999 into xend 
   exit witchanime3
end if
set bitmap of btn witch1 to witch1
wait 10 ticks
set bitmap of btn witch1 to witch3
wait 10 ticks
set bitmap of btn witch1 to witch1
wait 10 ticks
if mouseclick() then
   put 999 into xend 
   exit witchanime3
end if
set bitmap of btn witch1 to witch2
wait 10 ticks
set bitmap of btn witch1 to witch1
wait 10 ticks
end repeat
End witchanime3


On witchspranime
repeat 5 times
set bitmap of btn witch1 to wichspra
wait 2 ticks
set bitmap of btn witch1 to wichsprb
wait 2 ticks
set bitmap of btn witch1 to wichsprc
wait 2 ticks
set bitmap of btn witch1 to wichsprd
wait 2 ticks
set bitmap of btn witch1 to wichspre
wait 2 ticks
end repeat
set bitmap of btn witch1 to witchspr
wait 10 ticks
End witchspranime

On Showwitch_surprised
lock screen
hide btn sansumap
hide btn narator1
set bitmap of btn witch1 to witch1
show btn witch1
unlock screen
wait 10 ticks
set bitmap of btn witch1 to witchspr
wait 120 ticks
lock screen
hide btn witch1
show btn sansumap
show btn narator1
unlock screen
End Showwitch_surprised

On show_frog_good
put 2 into ntx
naratoranimex
wait 1 seconds
End show_frog_good


On k_froganime2
repeat with j = 1 to 2
set bitmap of btn k_frog1 to k_frog1
wait 2 ticks
set bitmap of btn k_frog1 to k_frog3
wait 2 ticks
set bitmap of btn k_frog1 to k_frog4
wait 2 ticks
set bitmap of btn k_frog1 to k_frog3
wait 2 ticks
end repeat
set bitmap of btn k_frog1 to k_frog2
wait 2 ticks

End k_froganime2


On k_froganime3
   put 0 into xend

repeat with j = 1 to f3x
if mouseclick() then
  put 999 into xend
exit k_froganime3
end if
set bitmap of btn narator1 to narator1
wait 7 ticks
set bitmap of btn narator1 to narator2
wait 7 ticks
set bitmap of btn narator1 to narator3
wait 7 ticks
set bitmap of btn narator1 to narator2
wait 7 ticks
end repeat
set bitmap of btn narator1 to narator1
wait 7 ticks

End k_froganime3





On kiddyanime
if xend = 999 then
    exit kiddyanime
end if
set bitmap of btn witch1 to kiddy1
wait 10 ticks
set bitmap of btn witch1 to kiddy2
wait 10 ticks
set bitmap of btn witch1 to kiddy3
wait 10 ticks
repeat with j = 1 to 3
if mouseclick() then
   put 999 into xend
   exit kiddyanime 
end if
set bitmap of btn witch1 to kiddy4
wait 5 ticks
set bitmap of btn witch1 to kiddy5
wait 5 ticks
set bitmap of btn witch1 to kiddy4
wait 5 ticks
set bitmap of btn witch1 to kiddy3
wait 5 ticks
end repeat

end kiddyanime




On kiddyanime16
if xend = 999 then
    exit kiddyanime16
end if
set bitmap of btn kiddy1 to kiddy1
wait 5 ticks
set bitmap of btn kiddy1 to kiddy2
wait 5 ticks
set bitmap of btn kiddy1 to kiddy3
wait 5 ticks
repeat with j = 1 to 4
if mouseclick() then
   put 999 into xend
   exit kiddyanime16 
end if
set bitmap of btn kiddy1 to kiddy4
wait 5 ticks
set bitmap of btn kiddy1 to kiddy5
wait 5 ticks
set bitmap of btn kiddy1 to kiddy4
wait 5 ticks
set bitmap of btn kiddy1 to kiddy3
wait 5 ticks
end repeat

end kiddyanime16








On mdragonanime1
repeat with j = 1 to 3
set bitmap of btn mdragon1 to mdragon2
wait 10 ticks
set bitmap of btn mdragon1 to mdragon3
wait 10 ticks
set bitmap of btn mdragon1 to mdragon2
wait 10 ticks
set bitmap of btn mdragon1 to mdragon1
wait 10 ticks
end repeat
end mdragonanime1



On k_froganime1
set the loc of btn k_froga to 93,318
show btn k_froga
repeat with j = 1 to 6
set bitmap of btn k_froga to k_frogc
wait 2 ticks
set bitmap of btn k_froga to k_frogd
wait 2 ticks
set bitmap of btn k_froga to k_frogc
wait 2 ticks
set bitmap of btn k_froga to k_froga
wait 2 ticks
end repeat
set bitmap of btn k_froga to k_frogb
wait 100 ticks
set the loc of btn k_froga to -250,318

set bitmap of btn k_froga to k_froga
hide btn k_froga

End k_froganime1


On naratoranime
show btn narator1
repeat 3 times
set bitmap of btn narator1 to narator2
wait 5 ticks
set bitmap of btn narator1 to narator1
wait 5 ticks
if random(10) = 8 then
 wait 10 ticks
end if
set bitmap of btn narator1 to narator2
wait 5 ticks
set bitmap of btn narator1 to narator3
wait 5 ticks
if random(10) = 8 then
 wait 10 ticks
end if
end repeat

End naratoranime

On naratoranimex
show btn narator1
repeat ntx times
set bitmap of btn narator1 to narator2
wait 5 ticks
if mouseclick() then
 exit repeat
end if

if random(15) = 8 then
 wait 10 ticks
if mouseclick() then
exit repeat
end if
end if
set bitmap of btn narator1 to narator1
wait 5 ticks
if mouseclick() then
exit repeat
end if

if random(15) = 8 then
 wait 10 ticks
if mouseclick() then
exit repeat
end if

end if
set bitmap of btn narator1 to narator2
wait 5 ticks
if mouseclick() then
exit repeat
end if

set bitmap of btn narator1 to narator3
wait 5 ticks
if mouseclick() then
exit repeat
end if

if random(15) = 8 then
 wait 10 ticks
if mouseclick() then
 exit repeat
end if

end if
end repeat

End naratoranimex



On naratoranimedummy
show btn narator1
repeat 3 times
set bitmap of btn narator1 to narator1
wait 5 ticks
set bitmap of btn narator1 to narator1
wait 5 ticks
end repeat

End naratoranimedummy




On opencard 3
if game_on = 1 then
SoundRandom
lock screen
show btn witch1
show btn k_frog1
hide btn 67

if grade_level = 0 then
   set bitmap of btn gradel to gradels
   set bitmap of btn gradem to gradem
   set bitmap of btn gradeh to gradeh
end if
if grade_level = 1 then
   set bitmap of btn gradel to gradel
   set bitmap of btn gradem to gradems
   set bitmap of btn gradeh to gradeh
end if
if grade_level = 2 then
   set bitmap of btn gradel to gradel
   set bitmap of btn gradem to gradem
   set bitmap of btn gradeh to gradehs
end if




set the loc of btn k_frog1 to locH of btn %frogloc%, locV of btn %frogloc%

put step2_egg into egg_cond_number

put 2 into target_egg
refreshegg
put step5_egg into egg_cond_number
put 5 into target_egg
refreshegg
put step8_egg into egg_cond_number
put 8 into target_egg
refreshegg
put step14_egg into egg_cond_number
put 14 into target_egg
refreshegg
put step18_egg into egg_cond_number
put 18 into target_egg
refreshegg
put step21_egg into egg_cond_number
put 21 into target_egg
refreshegg
put step22_egg into egg_cond_number
put 22 into target_egg
refreshegg
put step23_egg into egg_cond_number
put 23 into target_egg
refreshegg
put step25_egg into egg_cond_number
put 25 into target_egg
refreshegg
put step26_egg into egg_cond_number
put 26 into target_egg
refreshegg
put step28_egg into egg_cond_number
put 28 into target_egg
refreshegg
put step31_egg into egg_cond_number
put 31 into target_egg
refreshegg
put step32_egg into egg_cond_number
put 32 into target_egg
refreshegg
put step34_egg into egg_cond_number
put 34 into target_egg
refreshegg
--------------------------------------------------
put step38_egg into egg_cond_number

put 38 into target_egg
refreshegg
put step39_egg into egg_cond_number
put 39 into target_egg
refreshegg
put step41_egg into egg_cond_number
put 41 into target_egg
refreshegg
put step42_egg into egg_cond_number
put 42 into target_egg
refreshegg
put step43_egg into egg_cond_number
put 43 into target_egg
refreshegg
put step44_egg into egg_cond_number
put 44 into target_egg
refreshegg
put step45_egg into egg_cond_number
put 45 into target_egg
refreshegg
put step46_egg into egg_cond_number
put 46 into target_egg
refreshegg
put step47_egg into egg_cond_number
put 47 into target_egg
refreshegg
put step49_egg into egg_cond_number
put 49 into target_egg
refreshegg
put step50_egg into egg_cond_number
put 50 into target_egg
refreshegg
put step51_egg into egg_cond_number
put 51 into target_egg
refreshegg
unlock screen
else
put 0 into game_on
put 1 into grade_level
end if




if game_on is not 1  then
lock screen
show btn witch1
show btn gradeh
show btn gradem
show btn gradel
hide btn k_frog1




if grade_level = 0 then
   set bitmap of btn gradel to gradels
   set bitmap of btn gradem to gradem
   set bitmap of btn gradeh to gradeh
end if
if grade_level = 1 then
   set bitmap of btn gradel to gradel
   set bitmap of btn gradem to gradems
   set bitmap of btn gradeh to gradeh
end if
if grade_level = 2 then
   set bitmap of btn gradel to gradel
   set bitmap of btn gradem to gradem
   set bitmap of btn gradeh to gradehs
end if



unlock screen
set the loc of btn k_frog1 to 551,370
set the loc of btn narator1 to 551,370
-------- onlyonetimeanime
if  onlyonetime_flag is not 999 then
play eatingc

play muon
 put 999 into onlyonetime_flag
kingdom
end if
end if
put 0 into xend
End opencard





On opencard 3
if game_on = 1 then
SoundRandom
lock screen
show btn witch1
show btn k_frog1
hide btn 67

if grade_level = 0 then
   set bitmap of btn gradel to gradels
   set bitmap of btn gradem to gradem
   set bitmap of btn gradeh to gradeh
end if
if grade_level = 1 then
   set bitmap of btn gradel to gradel
   set bitmap of btn gradem to gradems
   set bitmap of btn gradeh to gradeh
end if
if grade_level = 2 then
   set bitmap of btn gradel to gradel
   set bitmap of btn gradem to gradem
   set bitmap of btn gradeh to gradehs
end if




set the loc of btn k_frog1 to locH of btn %frogloc%, locV of btn %frogloc%

put step2_egg into egg_cond_number

put 2 into target_egg
refreshegg
put step5_egg into egg_cond_number
put 5 into target_egg
refreshegg
put step8_egg into egg_cond_number
put 8 into target_egg
refreshegg
put step14_egg into egg_cond_number
put 14 into target_egg
refreshegg
put step18_egg into egg_cond_number
put 18 into target_egg
refreshegg
put step21_egg into egg_cond_number
put 21 into target_egg
refreshegg
put step22_egg into egg_cond_number
put 22 into target_egg
refreshegg
put step23_egg into egg_cond_number
put 23 into target_egg
refreshegg
put step25_egg into egg_cond_number
put 25 into target_egg
refreshegg
put step26_egg into egg_cond_number
put 26 into target_egg
refreshegg
put step28_egg into egg_cond_number
put 28 into target_egg
refreshegg
put step31_egg into egg_cond_number
put 31 into target_egg
refreshegg
put step32_egg into egg_cond_number
put 32 into target_egg
refreshegg
put step34_egg into egg_cond_number
put 34 into target_egg
refreshegg
--------------------------------------------------
put step38_egg into egg_cond_number

put 38 into target_egg
refreshegg
put step39_egg into egg_cond_number
put 39 into target_egg
refreshegg
put step41_egg into egg_cond_number
put 41 into target_egg
refreshegg
put step42_egg into egg_cond_number
put 42 into target_egg
refreshegg
put step43_egg into egg_cond_number
put 43 into target_egg
refreshegg
put step44_egg into egg_cond_number
put 44 into target_egg
refreshegg
put step45_egg into egg_cond_number
put 45 into target_egg
refreshegg
put step46_egg into egg_cond_number
put 46 into target_egg
refreshegg
put step47_egg into egg_cond_number
put 47 into target_egg
refreshegg
put step49_egg into egg_cond_number
put 49 into target_egg
refreshegg
put step50_egg into egg_cond_number
put 50 into target_egg
refreshegg
put step51_egg into egg_cond_number
put 51 into target_egg
refreshegg
unlock screen
else
put 0 into game_on
put 1 into grade_level
end if




if game_on is not 1  then
lock screen
show btn witch1
show btn gradeh
show btn gradem
show btn gradel
hide btn k_frog1




if grade_level = 0 then
   set bitmap of btn gradel to gradels
   set bitmap of btn gradem to gradem
   set bitmap of btn gradeh to gradeh
end if
if grade_level = 1 then
   set bitmap of btn gradel to gradel
   set bitmap of btn gradem to gradems
   set bitmap of btn gradeh to gradeh
end if
if grade_level = 2 then
   set bitmap of btn gradel to gradel
   set bitmap of btn gradem to gradem
   set bitmap of btn gradeh to gradehs
end if



unlock screen
set the loc of btn k_frog1 to 551,370
set the loc of btn narator1 to 551,370
-------- onlyonetimeanime
if  onlyonetime_flag is not 999 then
play eatingc

play muon
 put 999 into onlyonetime_flag
kingdom
end if
end if
put 0 into xend
End opencard


On refreshegg
if egg_cond_number = 1 then 
   set bitmap of btn %target_egg% to egg
else
   if egg_cond_number = 2 then
   set bitmap of btn %target_egg% to crackegg
   end if
   if egg_cond_number = 3 then
   set bitmap of btn %target_egg% to mdragon1
   end if
end if
   
End refreshegg










On kingdomtest

initialize
put 1 into game_on
put 0 into timecounter
lock screen
--hide btn 64
--show btn 66
hide btn 67
--hide btn gradeh
--hide btn gradem
--hide btn gradel
--hide fld easy
--hide fld soso
--hide fld hard
set the loc of btn k_frog1 to 565,251
show btn k_frog1
unlock screen
if grade_level = 0 then
  put 6 into dragontimes
  put 30 into responselimit
  put 20 into  maxeggnumber
end if
if grade_level = 1 then
  put 6 into dragontimes
  put 25 into responselimit
  put 15 into  maxeggnumber
end if
if grade_level = 2 then
  put 6 into dragontimes
  put 20 into responselimit
  put 10 into  maxeggnumber
end if

repeat with pointx = 1 to 12
  put 0 into Item pointx of checkcardlist
 end repeat  
put 0 into  minimum_level

SoundRandom
put random(3) into initialroute
if initialroute = 1 then
    put 25 into frogloc
     step25
  else
    if initialroute = 2 then
          put 25 into frogloc
          step25
     else
          put  25 into frogloc
          step25
     end if
 end if
End kingdomtest






On mdoor_open
       play creak
       set bitmap of btn s_door1 to s_door2
        wait 20 ticks
       set bitmap of btn s_door1 to s_door3
        wait 20 ticks
End mdoor_open







On kingdom
play synthri

initialize
put 1 into game_on
put 0 into timecounter
lock screen
--hide btn 64
--show btn 66
hide btn 67
--hide btn gradeh
--hide btn gradem
--hide btn gradel
--hide fld easy
--hide fld soso
--hide fld hard
set the loc of btn k_frog1 to 565,251
show btn k_frog1
unlock screen

if grade_level = 0 then
  put 6 into dragontimes
  put 30 into responselimit
  put 20 into  maxeggnumber
end if
if grade_level = 1 then
  put 6 into dragontimes
  put 25 into responselimit
  put 15 into  maxeggnumber
end if
if grade_level = 2 then
  put 6 into dragontimes
  put 20 into responselimit
  put 10 into  maxeggnumber
end if


repeat with pointx = 1 to 12
  put 0 into Item pointx of checkcardlist
 end repeat  
put 0 into  minimum_level

SoundRandom
put random(3) into initialroute
if initialroute = 1 then
    put 1 into frogloc
     step1
  else
    if initialroute = 2 then
          put 17 into frogloc
          step17
     else
          put  27 into frogloc
          step27
     end if
 end if
End kingdom

On checkegg

if crackedegg < maxcrackedegg then
put random(26) into j
repeat 2 times
 
if quiz_quit = 1 then
   exit repeat
end if
if  step2_egg = 1 and j < 1 then
    set bitmap of btn 2 to crackegg
    put 2 into step2_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if

if   step5_egg = 1 and j < 2 then
    set bitmap of btn 5 to crackegg
    put 2 into step5_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step8_egg = 1 and j < 3 then
    set bitmap of btn 8 to crackegg
    put 2 into step8_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step14_egg = 1 and j < 4 then
    set bitmap of btn 14 to crackegg
    put 2 into step14_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if  step18_egg = 1  and j < 5 then
    set bitmap of btn 18 to crackegg
    put 2 into step18_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step21_egg = 1  and j < 6 then
    set bitmap of btn 21 to crackegg
    put 2 into step21_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step22_egg = 1 and j < 7 then
    set bitmap of btn 22 to crackegg
    put 2 into step22_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step23_egg = 1 and j < 8 then
    set bitmap of btn 23 to crackegg
    put 2 into step23_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step25_egg = 1 and j < 9 then
    set bitmap of btn 25 to crackegg
    put 2 into step25_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step26_egg = 1 and j < 10 then
    set bitmap of btn 26 to crackegg
    put 2 into step26_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step28_egg = 1 and j < 11 then
    set bitmap of btn 28 to crackegg
    put 2 into step28_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step31_egg = 1 and j < 12 then
    set bitmap of btn 31 to crackegg
    put 2 into step31_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step32_egg = 1 and j < 13 then
    set bitmap of btn 32 to crackegg
    put 2 into step32_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step34_egg = 1 and j < 14 then
    set bitmap of btn 34 to crackegg
    put 2 into step34_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if


if   step38_egg = 1 and j < 15 then
    set bitmap of btn 38 to crackegg
    put 2 into step38_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step39_egg = 1 and j < 16 then
    set bitmap of btn 39 to crackegg
    put 2 into step39_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step41_egg = 1 and j < 17 then
    set bitmap of btn 41 to crackegg
    put 2 into step41_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step42_egg = 1 and j < 18 then
    set bitmap of btn 42 to crackegg
    put 2 into step42_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step43_egg = 1 and j < 19 then
    set bitmap of btn 43 to crackegg
    put 2 into step43_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
 if  step44_egg = 1 and j < 20  then
    set bitmap of btn 44 to crackegg
    put 2 into step44_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
 if  step45_egg = 1 and j < 21  then
    set bitmap of btn 45 to crackegg
    put 2 into step45_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step46_egg = 1 and j < 22  then
    set bitmap of btn 46 to crackegg
    put 2 into step46_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step47_egg = 1 and j < 23  then
    set bitmap of btn 47 to crackegg
    put 2 into step47_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step49_egg = 1 and j < 24  then
    set bitmap of btn 49 to crackegg
    put 2 into step49_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step50_egg = 1 and j < 25  then
    set bitmap of btn 50 to crackegg
    put 2 into step50_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step51_egg = 1 and j < 26  then
    set bitmap of btn 51 to crackegg
    put 2 into step51_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
put 0 into j
end repeat
end if

if  eggnumber >= maxeggnumber  and  quizongoing = 0 then
Game_Over
exit checkegg
end if


End checkegg

 
On checkzone1
if zone1 = 0 then
put random(6) into j
repeat with i = 1 to 6
if  step38_egg = 0  and j = 1 then
    show btn 38
    set bitmap of btn 38  to egg
    put 1 into step38_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if
if  step39_egg = 0  and j = 2 then
    show btn 39
    set bitmap of btn 39 to egg
    put 1 into step39_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if
if  step26_egg = 0  and j = 3 and frogloc is not 26 then
    show btn 26 
    set bitmap of btn 26 to egg
    put 1 into step26_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if
if  step25_egg = 0  and j = 4 and frogloc is not 25 then
    show btn 25 
    set bitmap of btn 25 to egg
    put 1 into step25_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if
if  step34_egg = 0  and j = 5 and frogloc is not 34 then
    show btn 34 
    set bitmap of btn 34 to egg
    put 1 into step34_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if
if  step14_egg = 0  and j = 6 and frogloc is not 14 then
    show btn 14 
    set bitmap of btn 14 to egg
    put 1 into step14_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if

put j + 1 into j

if j > 6 then
put 1 into j
end if

end repeat
end if 

if step38_egg = 1 and step39_egg = 1  and step26_egg = 1  and step25_egg = 1  and step34_egg = 1  and step14_egg = 1 then
put 1 into zone1
end if

end checkzone1


On checkzone2
if zone2 = 0 then
put random(3) into j
repeat with i = 1 to 3
if  step41_egg = 0  and j = 1 then
    show btn 41 
    set bitmap of btn 41 to egg
    put 1 into step41_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if
if  step42_egg = 0  and j = 2 then
    show btn 42 
    set bitmap of btn 42 to egg
    put 1 into step42_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if
if  step23_egg = 0  and j = 3 and frogloc is not 23 then
    show btn 23 
    set bitmap of btn 23 to egg
    put 1 into step23_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if

put j + 1 into j

if j > 3 then
put 1 into j
end if

end repeat
end if 

if step41_egg = 1 and step42_egg = 1  and step23_egg = 1 then
put 1 into zone2
end if

end checkzone2


On checkzone3
if zone3 = 0 then
put random(4) into j
repeat with i = 1 to 4
if  step43_egg = 0  and j = 1 then
    show btn 43
    set bitmap of btn 43 to egg
    put 1 into step43_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if
if  step44_egg = 0  and j = 2 then
    show btn 44 
    set bitmap of btn 44 to egg
    put 1 into step44_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if
if  step31_egg = 0  and j = 3 and frogloc is not 31 then
    show btn 31 
    set bitmap of btn 31 to egg
    put 1 into step31_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if

if  step32_egg = 0  and j = 4 and frogloc is not 32 then
    show btn 32 
    set bitmap of btn 32 to egg
    put 1 into step32_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if


put j + 1 into j

if j > 4 then
put 1 into j
end if

end repeat
end if 


if  step43_egg = 1  and step44_egg = 1  and step31_egg = 1  and step32_egg = 1 then
put 1 into zone3
end if

end checkzone3


On checkzone4
if zone4 = 0 then
put random(3) into j
repeat with i = 1 to 3
if  step21_egg = 0  and j = 1 and frogloc is not 21 then
    show btn 21 
    set bitmap of btn 21 to egg
    put 1 into step21_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if
if  step22_egg = 0  and j = 2 and frogloc is not 22 then
    show btn 22 
    set bitmap of btn 22 to egg
    put 1 into step22_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if
if  step50_egg = 0  and j = 3 then
    show btn 50 
    set bitmap of btn 50 to egg
    put 1 into step50_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if

put j + 1 into j

if j > 3 then
put 1 into j
end if

end repeat
end if 

if  step21_egg = 1  and step22_egg = 1  and step50_egg = 1 then
put 1 into zone4
end if

end checkzone4


On checkzone5
if zone5 = 0 then
put random(3) into j
repeat with i = 1 to 3
if  step49_egg = 0  and j = 1 then
    show btn 49 
    set bitmap of btn 49 to egg
    put 1 into step49_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if
if  step2_egg = 0  and j = 2 and frogloc is not 2 then
    show btn 2 
    set bitmap of btn 2 to egg
    put 1 into step2_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if
if  step18_egg = 0  and j = 3 and frogloc is not 18  then
    show btn 18 
    set bitmap of btn 18 to egg
    put 1 into step18_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if

put j + 1 into j

if j > 3 then
put 1 into j
end if

end repeat
end if 

if  step49_egg = 1  and step2_egg = 1  and step18_egg = 1 then
put 1 into zone5
end if

end checkzone5



On checkzone6
if zone6 = 0 then
put random(2) into j
repeat with i = 1 to 2
if  step5_egg = 0  and j = 1 then
    show btn 5 
    set bitmap of btn 5 to egg
    put 1 into step5_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if
if  step51_egg = 0  and j = 2 then
    show btn 51 
    set bitmap of btn 51 to egg
    put 1 into step51_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if

put j + 1 into j

if j > 2 then
put 1 into j
end if

end repeat
end if 

if  step5_egg = 1  and step51_egg = 1 and frogloc is not 5  then
put 1 into zone6
end if

end checkzone6

On checkzone7
if zone7 = 0 then

if  step47_egg = 0   then
    show btn 47 
    set bitmap of btn 47 to egg
    put 1 into step47_egg
    put eggnumber + 1 into eggnumber
    
end if
    put 1 into zone7
end if


end checkzone7


On checkzone8
if zone8 = 0 then
put random(4) into j
repeat with i = 1 to 4
if  step8_egg = 0  and j = 1 and frogloc is not 8 then
    show btn 8
    set bitmap of btn 8 to egg
    put 1 into step8_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if
if  step45_egg = 0  and j = 2 then
    show btn 45 
    set bitmap of btn 45 to egg
    put 1 into step45_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if
if  step46_egg = 0  and j = 3 then
    show btn 46 
    set bitmap of btn 46 to egg
    put 1 into step46_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if

if  step28_egg = 0  and j = 4 and frogloc is not 28 then
    show btn 28 
    set bitmap of btn 28 to egg
    put 1 into step28_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if


put j + 1 into j

if j > 4 then
put 1 into j
end if

end repeat
end if 

if  step8_egg = 1 and step45_egg = 1  and step46_egg = 1  and step28_egg = 1 then
put 1 into zone8
end if

end checkzone8

On dragonmoves
put random(8) into pos
repeat with m = 1 to 8
 if zone1 = 0 and pos = 1 then
   if random(4) = 2 then
   play eatingc
   else 
    SoundRandom
   end if
    put 1 into selectedzone
    dragonmove1
      if clicked = 1 or quiz_quit = 1 then
         exit repeat
      end if
    if timecounter > 2 then
      checkzone1
      put 0 into timecounter
    end if
  exit repeat
 end if

if zone2 = 0 and pos = 2 then
     if random(4) = 2 then
     play eatingc
      else 
    SoundRandom
    end if
 put 2 into selectedzone
    dragonmove2
         if clicked = 1 or quiz_quit = 1 then
          exit repeat
         end if
       if timecounter > 2 then
         checkzone2
       put 0 into timecounter
       end if
    exit repeat
 end if

if zone3 = 0 and pos = 3 then
   if random(4) = 2 then
    play eatingc
      else 
    SoundRandom
    end if
  put 3 into selectedzone
    dragonmove3
          if clicked = 1  or quiz_quit = 1 then
         exit repeat
      end if

   if timecounter > 2 then
         checkzone3
       put 0 into timecounter
       end if
 

  exit repeat
 end if


if zone4 = 0 and pos = 4 then
     if random(4) = 2 then
     play eatingc
      else 
       SoundRandom
     end if
 put 4 into selectedzone
    dragonmove4
      if clicked = 1 or quiz_quit = 1  then
         exit repeat
      end if

      if timecounter > 2 then
         checkzone4
       put 0 into timecounter
       end if


       exit repeat
 end if

if zone5 = 0 and pos = 5 then
     if random(4) = 2 then
     play eatingc
     else 
    SoundRandom
     end if
 put 5 into selectedzone
    dragonmove5
      if clicked = 1  or quiz_quit = 1 then
         exit repeat
      end if

  if timecounter > 2 then
         checkzone5
       put 0 into timecounter
       end if


  exit repeat
 end if

if zone6 = 0 and pos = 6 then
    if random(4) = 2 then
    play eatingc
    else 
    SoundRandom
    end if
  put 6 into selectedzone
       if clicked = 1  or quiz_quit = 1 then
         exit repeat
      end if
   dragonmove6

  if timecounter > 2 then
         checkzone6
       put 0 into timecounter
       end if

  exit repeat
 end if

if zone7 = 0 and pos = 7 then
  if random(4) = 2 then
  play eatingc
     else 
    SoundRandom
   end if
    put 7 into selectedzone
    dragonmove7
      if clicked = 1  or quiz_quit = 1 then
         exit repeat
      end if

  if timecounter > 2 then
         checkzone7
       put 0 into timecounter
       end if

  exit repeat
 end if

if zone8 = 0 and pos = 8 then
  if random(4) = 2 then
   play eatingc
     else 
    SoundRandom
   end if
    put 8 into selectedzone
    dragonmove8
      if clicked = 1 or quiz_quit = 1  then
         exit repeat
      end if

  if timecounter > 2 then
         checkzone8
       put 0 into timecounter
       end if


  exit repeat
 end if

put pos + 1 into pos
if pos > 8 then
  put 1 into pos
end if

end repeat





End dragonmoves

On basicdragonmove

repeat dragontimes times
set bitmap of btn mdragon1 to mdragon2
wait 7 ticks
if quiz_quit = 1 then 
exit repeat
end if
--if mouseclick() and quiz_quit= 0 and quizongoing = 0 then
--put 0 into timecounter
-- click at clickh(), clickv()
--end if
set bitmap of btn mdragon1 to mdragon3
wait 7 ticks
--if quiz_quit = 1 then 
--exit repeat
--end if
--if mouseclick() and quiz_quit= 0  and quizongoing = 0 then
--put 0 into timecounter
--click at clickh(), clickv()
 
--end if
set bitmap of btn mdragon1 to mdragon2
wait 7 ticks
--if quiz_quit = 1 then 
--exit repeat
--end if
--if mouseclick() and quiz_quit= 0  and quizongoing = 0 then
--put 0 into timecounter
-- click at clickh(), clickv()

--end if

set bitmap of btn mdragon1 to mdragon1
wait 7 ticks
--if quiz_quit = 1 then 
--exit repeat
--end if
--if mouseclick() and  quiz_quit= 0  and quizongoing = 0 then
--put 0 into timecounter
-- click at clickh(), clickv()

--end if
end repeat
put timecounter + 1 into timecounter
end basicdragonmove


On dragonmove1
repeat 2 times
put random(6) into k
if quiz_quit = 1 then
exit repeat
end if
if k =1 then
  set the loc of btn 56 to 32,130
end if
if k = 2 then
  set the loc of btn 56 to 44,130
end if
if k =3 then
  set the loc of btn 56 to 59,127
end if
if k =4 then
  set the loc of btn 56 to 75,122
end if
if k =5 then
  set the loc of btn 56 to 98,124
end if
if k =6 then
  set the loc of btn 56 to 109,115
end if
basicdragonmove
end repeat



End dragonmove1

On dragonmove2
put 0 into dragontimeup
repeat 2 times
if quiz_quit = 1 then
exit repeat
end if
put random(3) into k
if k =1 then
  set the loc of btn 56 to 12,236
end if
if k = 2 then
  set the loc of btn 56 to 19,243
end if
if k =3 then
  set the loc of btn 56 to 7,251
end if
basicdragonmove
end repeat

End dragonmove2

On dragonmove3
put 0 into dragontimeup
repeat 3 times
if quiz_quit = 1 then
exit repeat
end if
put random(5) into k
if k =1 then
  set the loc of btn 56 to 117,272
end if
if k = 2 then
  set the loc of btn 56 to 136,276
end if
if k = 3 then
  set the loc of btn 56 to 157,287
end if
if k =4 then
  set the loc of btn 56 to 145,297
end if
if k =5 then
  set the loc of btn 56 to 171,298
end if
basicdragonmove
end repeat


End dragonmove3

On dragonmove4
put 0 into dragontimeup
repeat 2 times
if quiz_quit = 1 then
exit repeat
end if
put random(4) into k
if k =1 then
  set the loc of btn 56 to 22,351
end if
if k = 2 then
  set the loc of btn 56 to 36,361
end if
if k =3 then
  set the loc of btn 56 to 47,373
end if
if k =4 then
  set the loc of btn 56 to 37,384
end if
basicdragonmove
end repeat


End dragonmove4


On dragonmove5
put 0 into dragontimeup
repeat 2 times
if quiz_quit = 1 then
exit repeat
end if
put random(4) into k
if k =1 then
  set the loc of btn 56 to 192,419
end if
if k = 2 then
  set the loc of btn 56 to 218,415
end if
if k =3 then
  set the loc of btn 56 to 238,423
end if
if k =4 then
  set the loc of btn 56 to 264,430
end if
basicdragonmove
end repeat


End dragonmove5


On dragonmove6
put 0 into dragontimeup
repeat 2 times
if quiz_quit = 1 then
exit repeat
end if
put random(4) into k
if k =1 then
  set the loc of btn 56 to 328,371
end if
if k = 2 then
  set the loc of btn 56 to 344,372
end if
if k =3 then
  set the loc of btn 56 to 364,373
end if
if k =4 then
  set the loc of btn 56 to 374,374
end if
basicdragonmove
end repeat


End dragonmove6

On dragonmove7
put 0 into dragontimeup
repeat 2 times
if quiz_quit = 1 then
exit repeat
end if
put random(3) into k
if k =1 then
  set the loc of btn 56 to 261,322
end if
if k = 2 then
  set the loc of btn 56 to 276,321
end if
if k =3 then
  set the loc of btn 56 to 288,320
end if
basicdragonmove
end repeat


End dragonmove7

On dragonmove8
put 0 into dragontimeup
repeat 2 times
if quiz_quit = 1 then
exit repeat
end if
put random(4) into k
if k =1 then
  set the loc of btn 56 to 340,197
end if
if k = 2 then
  set the loc of btn 56 to 353,207
end if
if k =3 then
  set the loc of btn 56 to 361,222
end if
if k =4 then
  set the loc of btn 56 to 344,230
end if
basicdragonmove
end repeat



End dragonmove8

On idle 3
if game_on = 1 and random(3) = 1 and frogloc is not 0 then
    set the loc of btn k_frog1 to locH of btn %frogloc%, locV of btn %frogloc%
end if
--if game_on = 1 and random(3) = 1 then
--    dragonmoves
--end if
--if game_on = 1 and random(2) = 1 then
--  checkegg
--end if
if game_on = 1 and random(2) = 1 then
   eggtodragon
end if
if game_on = 1 then 
randomdragonmove
end if

end idle

On exitkingdom
lock screen
show btn 64
set the loc of btn mdragon1 to 507,191
set the loc of btn k_frog1 to 551,370
set the loc of btn witch1 to 551,87
show btn 67
hide btn 66
    set bitmap of btn 2 to bw
    set bitmap of btn 5 to bw
    set bitmap of btn 8 to bw
    set bitmap of btn 14 to bw
    set bitmap of btn 18 to bw
    set bitmap of btn 21 to bw
    set bitmap of btn 22 to bw
    set bitmap of btn 23 to bw
    set bitmap of btn 25 to bw
    set bitmap of btn 26 to bw
    set bitmap of btn 28 to bw
    set bitmap of btn 31 to bw
    set bitmap of btn 32 to bw
    set bitmap of btn 34 to bw
    set bitmap of btn 38 to egg
    set bitmap of btn 39 to egg
    set bitmap of btn 41 to egg
    set bitmap of btn 42 to egg
    set bitmap of btn 43 to egg
    set bitmap of btn 44 to egg
    set bitmap of btn 45 to egg
    set bitmap of btn 46 to egg
    set bitmap of btn 47 to egg
    set bitmap of btn 49 to egg
    set bitmap of btn 50 to egg
    set bitmap of btn 51 to egg
hide btn 38
hide btn 39
hide btn 41
hide  btn 42
hide btn 45
hide btn 46
hide btn 47
hide btn 49
hide btn 50
hide btn 51
show btn gradeh
show btn gradem
show btn gradel
hide btn wichback
hide btn k_frog1
if grade_level = 0 then
   set bitmap of btn gradel to gradels
 set bitmap of btn gradem to gradem
 set bitmap of btn gradeh to gradeh
end if
if grade_level = 1 then
 set bitmap of btn gradel to gradel
   set bitmap of btn gradem to gradems
 set bitmap of btn gradeh to gradeh
end if
if grade_level = 2 then
 set bitmap of btn gradel to gradel
 set bitmap of btn gradem to gradem
 set bitmap of btn gradeh to gradehs
end if
show fld easy
show fld soso
show fld hard
unlock screen
put 0 into game_on
initialize
click at btn narator1
end exitkingdom


On entrancemessage
show btn t_writer
message2 141, 28, 9, "You must proceed from here toward the witch's castle step by step!"
hide btn t_writer

End entrancemessage


global frogloc
On step36
if game_on = 1 then
put frogloc into pre_frogloc
put 36 into frogloc
basicstepaction
end if
End step36

On step16
if game_on = 1 then
put frogloc into pre_frogloc
put 16 into frogloc
basicstepaction
end if
End step16

On step37
if game_on = 1 then
put frogloc into pre_frogloc
put 37 into frogloc
basicstepaction
end if
End step37

On step1
if game_on = 1 then
put frogloc into pre_frogloc
put 1 into frogloc
basicstepaction
end if
End step1


On step2
if game_on = 1 then
if  step2_egg = 0 then
put frogloc into pre_frogloc
put 2 into frogloc
basicstepaction
else
checkroute
end if
end if
End step2

On step3
if game_on = 1 then
put frogloc into pre_frogloc
put 3 into frogloc
basicstepaction
end if
End step3

On step4
if game_on = 1 then
put frogloc into pre_frogloc
put 4 into frogloc
basicstepaction
end if
End step4

On step5
if game_on = 1 then
if  step5_egg = 0 then
put frogloc into pre_frogloc
put 5 into frogloc
basicstepaction
else
checkroute
end if
end if
End step5


On step6
if game_on = 1 then
put frogloc into pre_frogloc
put 6 into frogloc
basicstepaction
end if
End step6


On step7
if game_on = 1 then
put frogloc into pre_frogloc
put 7 into frogloc
basicstepaction
end if
End step7


On step8
if game_on = 1 then
if step8_egg = 0 then
put frogloc into pre_frogloc
put 8 into frogloc
basicstepaction
else
checkroute
end if
end if
End step8


On step9
if game_on = 1 then
put frogloc into pre_frogloc
put 9 into frogloc
basicstepaction
end if
End step9


On step10
if game_on = 1 then
put frogloc into pre_frogloc
put 10 into frogloc
basicstepaction
end if
End step10

On step11
if game_on = 1 then
put frogloc into pre_frogloc
put 11 into frogloc
basicstepaction
end if
End step11

On step12
if game_on = 1 then
put frogloc into pre_frogloc
put 12 into frogloc
basicstepaction
end if
End step12

On step13
if game_on = 1 then
put frogloc into pre_frogloc
put 13 into frogloc
basicstepaction
end if
End step13

On step14
if game_on = 1 then
if step14_egg = 0 then
put frogloc into pre_frogloc
put 14 into frogloc
basicstepaction
else
checkroute
end if
end if
End step14


On step15
if game_on = 1 then
put frogloc into pre_frogloc
put 15 into frogloc
basicstepaction
end if
End step15


On step17
if game_on = 1 then
put frogloc into pre_frogloc
put 17 into frogloc
basicstepaction
end if
End step17


On step18
if game_on = 1 then
if step18_egg = 0 then
put frogloc into pre_frogloc
put 18 into frogloc
basicstepaction
else
checkroute
end if
end if
End step18


On step19
if game_on = 1 then
put frogloc into pre_frogloc
put 19 into frogloc
basicstepaction
end if
End step19

On step20
if game_on = 1 then
put frogloc into pre_frogloc
put 20 into frogloc
basicstepaction
end if
End step20


On step21
if game_on = 1 then
if step21_egg = 0 then
put frogloc into pre_frogloc
put 21 into frogloc
basicstepaction
else
checkroute
end if
end if
End step21


On step22
if game_on = 1 then
if  step22_egg = 0 then
put frogloc into pre_frogloc
put 22 into frogloc
basicstepaction
else
checkroute
end if
end if
End step22


On step23
if game_on = 1 then
if step23_egg = 0 then
put frogloc into pre_frogloc
put 23 into frogloc
basicstepaction
else
checkroute
end if
end if
End step23


On step24
if game_on = 1 then
put frogloc into pre_frogloc
put 24 into frogloc
basicstepaction
end if
End step24


On step25
if game_on = 1 then
if step25_egg = 0 then
put frogloc into pre_frogloc
put 25 into frogloc
basicstepaction
else
checkroute
end if
end if
End step25


On step26
if game_on = 1 then
if step26_egg = 0 then
put frogloc into pre_frogloc
put 26 into frogloc
basicstepaction
else
checkroute
end if
end if
End step26


On step27
if game_on = 1 then
put frogloc into pre_frogloc
put 27 into frogloc
basicstepaction
end if
End step27


On step28
if game_on = 1 then
if step28_egg = 0  then
put frogloc into pre_frogloc
put 28 into frogloc
basicstepaction
else
checkroute
end if
end if
End step28


On step29
if game_on = 1 then
put frogloc into pre_frogloc
put 29 into frogloc
basicstepaction
end if
End step29


On step30
if game_on = 1 then
put frogloc into pre_frogloc
put 30 into frogloc
basicstepaction
end if
End step30


On step31
if game_on = 1 then
put frogloc into pre_frogloc
put 31 into frogloc
basicstepaction
end if
End step31


On step32
if game_on = 1 then
if step32_egg = 0 then
put frogloc into pre_frogloc
put 32 into frogloc
basicstepaction
else
checkroute
end if
end if
End step32


On step33
if game_on = 1 then
put frogloc into pre_frogloc
put 33 into frogloc
basicstepaction
end if
End step33


On step34
if game_on = 1 then
if  step34_egg = 0 then
put frogloc into pre_frogloc
put 34 into frogloc
basicstepaction
else
checkroute
end if
end if
End step34


On step35
if game_on = 1 then
put frogloc into pre_frogloc
put 35 into frogloc
basicstepaction
end if
End step35




On SoundRandom
put random(5) into basicsnd
if basicsnd = 1 then 
   play mendel1
end if
if basicsnd = 2 then 
   play mendel2
end if
if basicsnd = 3 then 
   play mendel3
end if
if basicsnd = 4 then 
   play mendel5
end if
End SoundRandom


On basicstepaction
----------------
if game_on is not 1 then
   exit basicstepaction
end if
--put 0 into  quiz_quit
checkegg
if game_on is not 1 then
   exit basicstepaction
end if
SoundRandom
set the loc of btn k_frog1 to  locH of btn %frogloc% , locV of btn %frogloc% - 30



if (frogloc >= 1) and (frogloc < 36) and (frogloc is not 16) then

   if(frogloc = 3 or frogloc = 18 or frogloc = 5 or frogloc = 7 or frogloc = 8 or frogloc = 30 or frogloc = 2 or frogloc = 6)  then
      if random(3) is not 1 then
        put 0 into  quiz_quit
       M_KingdomTours
      if math_answer = 1 then
        checkroute
           exit basicstepaction

       else
            checkzonex
         click at %frogloc%
           exit basicstepaction

       end if

--       exit basicstepaction
      end if
   end if

   if(frogloc = 21 or frogloc = 23 or frogloc = 11 or frogloc = 13 or frogloc = 25 or frogloc = 34 or frogloc = 22 or frogloc = 33 or frogloc = 14)  then
      if random(3) is not 1 then
       put 0 into  quiz_quit
 
        M_KingdomTours
       if math_answer = 1 then
        checkroute
            exit basicstepaction

       else
         checkzonex
         click at %frogloc%
           exit basicstepaction

       end if
--           exit basicstepaction
      end if
   end if






  put 0 into  quiz_quit
 
     if grade_level = 0 then
                quiz100
     end if

     if grade_level = 1 then
           quiz101
    end if

      if grade_level = 2 then
                quiz102
      end if

  set the loc of btn k_frog1 to  locH of btn %frogloc% , locV of btn %frogloc% -30

 end if


if game_on is not 1 then
   exit basicstepaction
end if


wait 30 ticks
SoundRandom


checkzonex


-----------------


End basicstepaction




On checkzonex

 if pos = 1 and (math_time > responselimit or  math_answer is not 1 ) then
   checkzone1
 end if

if pos = 2 and (math_time > responselimit or  math_answer is not 1 ) then
   checkzone2
 end if

 if pos = 3 and (math_time > responselimit or  math_answer is not 1 ) then
   checkzone3
 end if
if pos = 4 and (math_time > responselimit or  math_answer is not 1 ) then
   checkzone4
 end if

 if pos = 5 and (math_time > responselimit or  math_answer is not 1 ) then
   checkzone5
 end if
if pos = 6 and (math_time > responselimit or  math_answer is not 1 ) then
   checkzone6
 end if
if pos = 7 and (math_time > responselimit or  math_answer is not 1 ) then
   checkzone7
 end if
if pos = 8 and (math_time > responselimit or  math_answer is not 1 ) then
   checkzone8
 end if


End checkzonex






















On quiz100
put 89 into totalquiznum
put 0 into quiz_quit
put 0 into foundquiz
put 1 into quizongoing
put random(89) into chosenedquiz


repeat 101 times


if chosenedquiz = 1 and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "What added to 35 equals 42 ?", 7

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 2 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg4 "What added to 13 equals 78 ?", 65

put 1 into Item chosenedquiz of xquiztbl
exit repeat

end if

if chosenedquiz = 3 and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "What added to 29 equals 66 ?",37
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 4  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "What added to 28 equals 84 ?", 56

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 5 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg4 "14 + 73 = ?", 87
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if
-----------------
if chosenedquiz = 6 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg4 "59 + 34 = ?", 93
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 7 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg4 "53 + 47 = ?",100
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 8 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg4 "28 + 62  = ?", 90
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 9 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg4 "14 + 78 = ?", 92
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 10  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "14 + 37 = ?", 51
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 11  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "65 + 35 = ?", 100
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 12  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "260 + 220 = ?", 480
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 13  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "730 + 180 = ?", 910
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 14  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "450 + 370 = ?", 820
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 15  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "17 out of 45 birds are male. How many are female?", 28


put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 16  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "12 out of 30 flower stalks were cut down. How many remain?", 18

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 17  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "11 out of 18 bananas were eaten. How many are left?", 7

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 18  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "850 - 220  = ?", 630
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 19  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "450 - 130  = ?", 320
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 20  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "980 - 360  = ?", 620
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 21  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "800 - 480  = ?", 320
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 22  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "73 - 31 = ?", 42
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 23  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "48 - 16 = ?", 32
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 24  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "91 - 42 = ?", 49
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 25  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "10 x 4 = ?", 40
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 26  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "8 x 10 = ?", 80

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 27  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "30 x 3 = ?", 90
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 28  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "70 x 6 = ?", 420
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 29  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "40 x 7 = ?",280
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 30  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg3 "78921 ? 78032", 7
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 31  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg3 "30044 ? 76032", 5
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 32  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg3 "3000 ? 30000", 5
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 33  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg3 "180000 ? 18000", 7
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 34  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Obtain the sum of five hundred thousands and thirty thousands", 530000
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 35  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg3 "180000+3000 ? 180000", 7
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 36  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg3 "80000+200 ? 80000+2000", 5
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 37  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "A diameter of a circle is __ times longer than the radius.", 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 38  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Sharing 5 candies among 2 boys leaves a remainder of __", 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 39  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Sharing 7 oranges among 3 people leaves a remainder of __", 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 40  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Sharing 5 candies among 2 boys gives __ candies to each boy", 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 41  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 " 100 x 5 = ?", 500
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 42  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "300 x 2 = ?", 600
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 43  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "800 x 6  = ?", 4800
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 44  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "400 x 6  = ?", 2400
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 45  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "200 x 7 = ?", 1400
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 46  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "50 x 5 = ?", 250
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 47  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "70 x 8 = ?", 560
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 48  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "600 x 4 = ?", 2400
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 49  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "9 x 60 = ?", 540
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 50  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "8 x 700 = ?", 5600
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 51  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "23 x 2 x 3 = ?", 138
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 52  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "31 x 2 x 4 =  ? ",248
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 53  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "64 x 2 x 5 = ?", 640
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 54  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "5 x 2 x 15 =  ?", 150
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 55  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "3 x 3 x 10 =  ?", 90
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 56  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "52 x 10 x 10 =  ?", 5200
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 57  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "27 x 3 x 2 =  ?", 162
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 58  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "310 x 3 =  ?", 930
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 59  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "210 x 4 =  ? ", 840
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 60  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "260 x 3 =  ?", 780
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 61  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "240 x 4 =  ?", 960
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 62  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "190 x 4 = ?", 760
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 63  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "22 x 3 =  ?", 66
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 64  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "12 x 4=  ?", 48

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 65  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "18 x 3=  ?", 54
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 66  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "12 x 5 =  ?  ", 60
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 67  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "24 x 3 =  ?", 72
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 68  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "50 x 3 x 3 =  ?", 450
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 69  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "2 x 34 x 2 =  ?", 136
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 70  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "? x 9 = 54", 6
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 71  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "6 x ? = 48", 8
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 72  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "? x 7 =  49 ", 7
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 73  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "16 x ? = 64",4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if




if chosenedquiz = 74  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "5 boys share 10 bananas. Each gets __banana(s)", 2
exit repeat
end if

if chosenedquiz = 75  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "2 men share 8 nuts. Each gets __ nut(s)", 4
exit repeat
end if

if chosenedquiz = 76  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "4 girls share 20 candies. Each gets __ candies", 5
exit repeat
end if

if chosenedquiz = 77  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "10 people carry 40 chairs. Each has to carry __ chairs", 4
exit repeat
end if



if chosenedquiz = 78  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "One minute is ___ sec.", 60
exit repeat
end if



if chosenedquiz = 79  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "2 min. are ____ sec.", 120
exit repeat
end if

if chosenedquiz = 80  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "3 min. are ____ sec.", 180
exit repeat
end if


if chosenedquiz = 81  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "4 min. are ____ sec.", 240
exit repeat
end if

if chosenedquiz = 82  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "1 Km is  ____ m.", 1000
exit repeat
end if



if chosenedquiz = 83  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "2 Km is  ____  m.", 2000
exit repeat
end if

if chosenedquiz = 84  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Input fortyfive thousand three", 45003
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 85  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Input five thousand three hundred twenty-four", 5324
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 86  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Input seventy-nine thousand fifteen", 79015
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 87  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "1000 multiplied by 31 equals ___", 31000
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 88  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Three fewer than 20,000 is  ___", 19997
exit repeat
end if

if chosenedquiz = 89  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Adding 332 to three million makes ____", 3000332
exit repeat
end if




put chosenedquiz +1 into chosenedquiz
if chosenedquiz > totalquiznum then
put 1 into chosenedquiz
end if

end repeat






repeat while quiz_quit = 0
dragonmoves
checkegg
 eggtodragon
All_refreshed
wait 30 ticks
end repeat


--put 0 into quiz_quit
put 0 into quizongoing

if math_answer = 1 and math_time <= responselimit then
    randomok
    k_froganime2
---------------------------------------------------
   if frogloc = 35 or frogloc = 26 or frogloc = 15 then
      mdoor_open
       wait 40 ticks
       play magice
        set bitmap of btn witch1 to kiddy3
        wait 30 ticks
        set bitmap of btn witch1 to kiddy4
        wait  2 seconds
         play boingg
        witchspranime

        play hallel2

        wait 4 seconds
        play Beethovn
        exitkingdom
        exit quiz100
--------------------------- end game


   end if

  checkroute
   exit quiz100
  
else

if math_answer = -1 then
  game_over2
  exit quiz100
end if
   if(math_answer is not 1 ) then
   play jawharp
   set bitmap of btn witch1 to witchspr
   wait 2 seconds
   set bitmap of btn witch1 to witch1
   end if
if (math_time > responselimit)  then 
   latemessage
end if
if  ( math_answer is not 1 ) then 
   checkzonex
end if

click at btn %frogloc%
end if





-----------------------------------------------------------



end quiz100










On quiz101
put 80 into totalquiznum
put 0 into quiz_quit
put 0 into foundquiz
put 1 into quizongoing
put random(80) into chosenedquiz


repeat 101 times


if chosenedquiz = 1 and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "80 divided by 2 equals ___", 40

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 2 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg4 "40 divided by 10 equals ___", 4

put 1 into Item chosenedquiz of xquiztbl
exit repeat

end if

if chosenedquiz = 3 and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "48 divided by 6 equals ____",8
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 4  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "630 divided by 7 equals ___", 90

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 5 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg4 "56 / 7 = ?", 8
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 6 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg4 "90 / 9 = ?", 10
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 7 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg4 "81 / 9 = ?",9
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 8 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg4 "16 / 4 = ?", 4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 9 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg4 "24 / 8 = ? ", 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 10  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "15 / 5 = ?", 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 11  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg9 "4 / 3 = __ with a remainder of __ ", 1, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 12  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg9 "2 / 3 = __ with a remainder of __ ", 0,2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 13  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg9 "5 / 3 = __ with a remainder of __ ", 1,2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 14  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg9 "25 / 4 = __ with a remainder of ___ ", 6,1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 15  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "2 people share 25 candies. How many remain?", 1


put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 16  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "16 out of 54 flower stalks were cut down. How many remain?", 38

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 17  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "4 out of 23 bananas were eaten. How many remain?", 19

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 18  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg9 "25 / 4 = __ with a remainder of __ ", 6,1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 19  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg9 "45 / 6 = __ with a remainder of ___ ", 7,3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 20  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg9 "7 / 8 = __ with a remainder of ___ ", 0,7
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 21  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg9 "3 / 9 = __ with a remainder of ___ ", 0,3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 22  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg9 "10 / 9 = __ with a remainder of ___ ", 1, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 23  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg9 "5  / 4 = __ with a remainder of ___ ", 1, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 24  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg9 " 6 / 5 = __ with a remainder of __ ", 1, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 25  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg9 "3 / 3 = __ with a remainder of ___ ", 1, 0
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 26  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg9 "18 / 9 = __ with a remainder of ___ ", 2, 0

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 27  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg9 " 0 / 3 = __ with a remainder of ___ ", 0, 0
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 28  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Input five hundred thousand", 500000
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 29  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Input three hundred thirty-seven thousand", 337000
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 30  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Input nine hundred ninety thousand eighty-eight", 990088
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 31  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Input a hundred thirty thousand fifty", 130050
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 32  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "540 multiplied by 10 equals ___", 5400
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 33  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "31 multiplied by 100 quals ____", 3100
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 34  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "70 divided by 10 equals ____", 7
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 35  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "36 divided by 6 equals ____", 6
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 36  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "901 x 10 = ?", 9010
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 37  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "81 divided by 9 equals ?", 9
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 38  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "360 x 100 = ?", 36000
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 39  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "7000 x 10 = ?", 70000
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 40  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "57832 x 100 = ?", 5783200
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 41  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "90 sec. is equal to 1 min. and ___sec.", 30
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 42  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "130 sec. is equal to 2 min. and ___sec.", 10
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 43  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "5 min. is equal to ___sec.", 300
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 44  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "3 min. is equal to  ___sec.", 180
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 45  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "6 min. is equal to  ___sec.", 360
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 46  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "2 min. is equal to ___sec.", 120
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 47  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "2 min. 10 sec. exceed 30 sec. by __sec.", 100
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 48  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "1 min. 10 sec. exceed 45 sec. by __sec. ", 25
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 49  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "5 min. 10 sec. exceed 3 min. by __sec.", 130
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 50  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "4 min. exceed 2 min. 20 sec. by __sec.", 100
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 51  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "3 min. 1 sec. exceed 20 sec. by ___sec.", 161
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 52  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "5 min. ___sec. exceeds 4 min. 1 sec. by 70 sec.", 11
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 53  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "3 min. ___sec. exceeds 1 min. 10 sec. by 135 sec.", 25
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 54  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Adding 150 sec. to 1 min. 40 sec. is equal to 4min. ___sec.", 10
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if





if chosenedquiz = 55  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg6 "365 mm is equal to ___cm ___mm", 365
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 56  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg6 "225 mm is equal to __cm __mm", 225
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 57  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg6 "545 mm is equal to  ___cm ___mm", 545
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 58  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "3Km is equal to ___m", 3000
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 59  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "4Km is equal to ___m", 4000
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 60  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "4Kg500g is equal to ____g", 4500
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 61  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "3Kg6g is equal to ___g", 3006
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 62  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "1 Kg is equal to ____g", 1000
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 63  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "3Kg540g is equal to ___g", 3540
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 64  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg12 "The sum of 1Kg500g and 160g is ___Kg___g", 1660
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 65  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg12 "The sum of 560g and 700g is __Kg__g",1260
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 66  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg12 "Subtracting 700g from 2Kg leaves ___Kg__g",1300
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 67  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Input thityfour thousands, eight hundreds seventyone", 34871
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 68  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Input nine thousands, two hundreds nineteen.",9219
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 69  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "340000 +  14000 = ?", 354000
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 70  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Adding 900g to ____g makes 1Kg200g",300
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 71  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg14 "The sum of 5400ml and 700ml is __L__ml",61
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 72  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg14 "The sum of 3400ml and 2000ml is __L__ml",54
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 73  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg14 "The sum of 1400ml and 700ml is __L__ml",21
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 74  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg14 "Subtracting 2L 300ml from 3L leaves __L__ml",7
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 75  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg14 "2L 500ml and 3L 100ml are summed to be __L__ml",56
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 76  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg14 "4L 300ml and 2L 400ml are summed to be __L__ml",67
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 77  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg14 "10L 800ml and  21L 700ml are summed to be __L__ml",325
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 78  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg14 "15L 500ml and  3L 300ml are summed to be __L__ml",188
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 79  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg14 "7L 300ml differs from 3L 400ml by __L__ml",39
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 80  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg14 "3L 400ml differs from 1L 800ml by  __L__ml",16
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if







put chosenedquiz +1 into chosenedquiz
if chosenedquiz > totalquiznum then
put 1 into chosenedquiz
end if

end repeat




-------------------------



repeat while quiz_quit = 0
dragonmoves
checkegg
 eggtodragon
All_refreshed
wait 30 ticks
end repeat




--put 0 into quiz_quit
put 0 into quizongoing

if math_answer = 1 and math_time <= responselimit then
    randomok
    k_froganime2
---------------------------------------------------
   if frogloc = 35 or frogloc = 26 or frogloc = 15 then
      mdoor_open
       wait 40 ticks
       play magice
        set bitmap of btn witch1 to kiddy3
        wait 30 ticks
        set bitmap of btn witch1 to kiddy4
        wait  2 seconds
         play boingg
        witchspranime

        play hallel2

        wait 4 seconds
        play Beethovn
        exitkingdom
        exit quiz101
--------------------------- end game


   end if

  checkroute
  exit quiz101
else

if math_answer = -1 then
  game_over2
  exit quiz101
end if
   if(math_answer is not 1 ) then
   play jawharp
   set bitmap of btn witch1 to witchspr
   wait 2 seconds
   set bitmap of btn witch1 to witch1
   end if
if (math_time > responselimit)  then 
   latemessage
end if
if  ( math_answer is not 1 ) then 
   checkzonex
end if

click at btn %frogloc%
exit quiz101
end if





-----------------------------------------------------------


end quiz101




------------------





On quiz102
put 89 into totalquiznum
put 0 into quiz_quit
put 0 into foundquiz
put 1 into quizongoing
put random(89) into chosenedquiz


repeat 102 times



if chosenedquiz = 1 and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "10 divided by 2 equals ?",5

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 2 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg4 "40 divided by 10 equals ?", 4

put 1 into Item chosenedquiz of xquiztbl
exit repeat

end if

if chosenedquiz = 3 and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "480 divided by 6 equals ?",80
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 4  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "630 divided by 7 equals ?", 90

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 5 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg4 "9Kg is equal to __g.", 9000
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 6 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg4 "30mm is equal to __cm.", 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 7 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg4 "900 / 3 = ?",300
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 8 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg4 "160 / 4 = ?", 40
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 9 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg4 "240 / 8 = ? ", 30
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 10  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "9cm is greater than 76mm  by ___mm", 14
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 11  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg9 "4 / 3 = ___ with a remainder of ___ ", 1, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 12  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg9 "2 / 3 = ___ with a remainder of ___ ", 0,2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 13  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg9 "8 / 3 = ___ with a remainder of ___ ", 2,2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 14  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "8cm is ___times greater than 8mm", 10
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 15  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "25 candies are shared by 3 boys. How many remain?", 1


put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 16  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "46 out of 54 people are boys. How many are girls?", 8

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 17  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "4 out of 31 bananas were eaten. How many are left?", 27

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 18  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg9 "28 / 8 = ___ with a remainder of ___ ", 3,4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 19  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg9 "45 / 9 = ___ with a remainder of ___ ", 5,0
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 20  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg9 "7 / 8 = ___ with a remainder of ___ ", 0,7
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 21  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg9 "3 / 9 = ___ with a remainder of ___ ", 0,3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 22  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg9 "80 / 9 = ___ with a remainder of ___ ", 8, 8
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 23  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg9 "9  / 4 = ___ with a remainder of ___ ", 2, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 24  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg9 "7 / 5 = ___ with a remainder of ___ ", 1, 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 25  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg9 "63 / 8 = ___ with a remainder of ___ ", 7, 7
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 26  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "The sum of 7g and 15g is __g", 22

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if
--------------------------
if chosenedquiz = 27  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg6 " 156mm is equal to __cm__mm ", 156
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 28  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg12 " 1086g is equal to __Kg__g ", 1086
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 29  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg12 " 2000g is equal to __Kg__g ", 2000
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 30  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg12 "155g is equal to __Kg__g ", 155
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if
--------------------

if chosenedquiz = 31  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg12 "10052g is equal to __Kg__g ", 10052
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 32  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg14 "3600 ml is equal to  __L__ml", 36
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 33  and Item chosenedquiz of xquiztbl  is not 1 then
QuizDlg4 "36 L is equal to __ml ", 360
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 34  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg14 "41200ml  is equal to  __L__ml", 412
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 35  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg14 "15600ml  is equal to  __L__ml", 156
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 36  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg14 "25600ml is equal to  __L__ml", 256
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 37  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg14 "800ml short of 3L is  __L__ml", 22
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 38  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg14 "600ml short of  2L is __L__ml", 14
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 39  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg14 "Adding 3L to 1500ml makes  __L__ml", 45
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 40  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg12 "Adding 1032g to 10Kg makes __Kg__g", 11032
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 41  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg12 "500g short of 10Kg is equal to __Kg__g", 9500
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 42  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg12 "200g short of 3000g is equal to __Kg__g", 2800
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 43  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg12 "6 pieces of 200g meat weighs ___Kg__g", 1200
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 44  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg6 "Adding 20mm to 56cm makes__cm__mm", 580
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if
------------

if chosenedquiz = 45  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg12 "3 pieces of 350g meat weighs __Kg__g", 1050
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 46  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg12 "200g meat was sliced into 5 pieces. Each piece weighs __Kg __g", 40
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


--------------------

if chosenedquiz = 47  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "32 x 5 =", 160
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 48  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "8 multiplied by 4 equals ____.", 32
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if
--------
if chosenedquiz = 49  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Input ten thousand eight hundred forty-eight", 10848
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 50  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Input a hundred eighty thousand seven hundred", 180700
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 51  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "520 multiplied by 100 equals ?", 52000
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 52  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "47 multiplied by 100 equals ?", 4700
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 53  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "7000 divided by 10 equals ?", 700
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 54  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "37000 divided by 10 equals?", 3700
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 55  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "81 x 5 = ?", 405
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 56  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "59 x 3 = ?", 177
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 57  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "360 x 100 = ?", 36000
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 58  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "7000 x 10 = ?", 70000
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 59  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "57832 x 100 = ?", 5783200
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 60  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "86 sec. is equal to 1 min. ____ sec.", 26
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 61  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "131 sec. is equal to 2 min. ____ sec.", 11
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 62  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "4 min. is equal to ____ sec.", 240
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 63  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "3 min. is equal to ____ sec.", 180
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 64  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "7 min. is equal to ____ sec.", 420
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 65  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "8 min. is equal to ____ sec.", 480
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 66  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "2 min. 10 sec. differs from 1 min. 30 sec. by ___sec. ", 40
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 67  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "1 min. 10 sec. differs from 45 sec. by ___ sec.", 25
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 68  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "5 min. 10 sec. differs from 200 sec. by ___sec. ", 110
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 69  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "4 min. 1 sec. differs from 2 min. 20 sec. by __sec.", 101
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 70  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "4 min. 33 sec. differs from 2 min. 20 sec. by __sec. ", 133
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 71  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "The sum of 241 sec. and 2 min. 20 sec. is ___sec.", 381
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 72  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Adding 80 sec. to 2 min. 15 sec. makes 3 min. __sec.", 35
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 73  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Adding 100 sec. to 2 min. 30 sec. make 4 min. __sec.", 10
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if





if chosenedquiz = 74  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "27  divided by 3 equals ?", 9
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 75  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg6 "225 mm is equal to  ___cm __mm", 225
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 76  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg6 "545 mm is equal to __cm __mm", 545
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 77  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "42 - 17 = ?", 25
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 78  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "4Km is equal to ___m", 4000
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 79  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "4Kg300g is equal to _____g", 4300
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 80  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "3Kg16g is equal to ____g", 3016
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 81  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "21 - 5 = ?", 16
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 82  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "3Kg520g is equal to ____g", 3520
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 83  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg12 "The sum of 1Kg500g and 160g is ___Kg___g", 1660
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 84  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg12 "The sum of 560g and 700g is __Kg__g",1260
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 85  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg12 "Subtracting 700g from 2Kg leaves ___Kg__g",1300
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 86  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Input thirty-four thousand one hundred seventy-one", 34171
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 87  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "16 / 2 = ?", 8
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 88  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "28 /4 = ?", 7
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 89  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "36 /4  = ?",9
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if










put chosenedquiz +1 into chosenedquiz
if chosenedquiz > totalquiznum then
put 1 into chosenedquiz
end if

end repeat



---------------------------------

repeat while quiz_quit = 0
dragonmoves
checkegg
 eggtodragon
All_refreshed
wait 30 ticks
end repeat




--put 0 into quiz_quit
put 0 into quizongoing

if math_answer = 1 and math_time <= responselimit then
    randomok
    k_froganime2
---------------------------------------------------
   if frogloc = 35 or frogloc = 26 or frogloc = 15 then
      mdoor_open
       wait 40 ticks
       play magice
        set bitmap of btn witch1 to kiddy3
        wait 30 ticks
        set bitmap of btn witch1 to kiddy4
        wait  2 seconds
         play boingg
        witchspranime

        play hallel2

        wait 4 seconds
        play Beethovn
        exitkingdom
        exit quiz102
--------------------------- end game


   end if

  checkroute
 exit quiz102

else

if math_answer = -1 then
  game_over2
  exit quiz102
end if
   if(math_answer is not 1 ) then
   play jawharp
   set bitmap of btn witch1 to witchspr
   wait 2 seconds
   set bitmap of btn witch1 to witch1
   end if
if (math_time > responselimit)  then 
   latemessage
end if
if  ( math_answer is not 1 ) then 
   checkzonex
end if

click at btn %frogloc%
end if





-----------------------------------------------------------


--------------------------------

end quiz102





--------------------------





On latemessage
show btn t_writer
message2 141, 28, 9, "Aha! It is too late for you to answer!"
hide btn t_writer





End latemessage










On randomok
put random(3) into rdmok
play muon
wait 30 ticks
if rdmok = 1 then
   play good
end if
if rdmok = 2 then
   play alright
end if
if rdmok = 3 then
   play alrighth
end if
End randomok




On randomng
play muon
wait 30 ticks
put random(2) into rdmng
if rdmng = 1 then
   play jawharp
end if
if rdmng = 2 then
   play uhoh2
end if
End randomng

On eggtodragon

if  step2_egg = 2 then
   put 2 into fuka_btn_no
    put 3 into step2_egg
    
    littledragonmove
end if

if   step5_egg = 2 then
   put 5 into fuka_btn_no
    put 3 into step5_egg
    
    littledragonmove
end if
if   step8_egg = 2  then
   put 8 into fuka_btn_no
    put 3 into step8_egg
    
    littledragonmove
end if
if   step14_egg = 2  then
   put 14 into fuka_btn_no
    put 3 into step14_egg
    
    littledragonmove
end if
if  step18_egg = 2  then
   put 18 into fuka_btn_no
    put 3 into step18_egg
    
    littledragonmove
end if
if   step21_egg = 2  then
   put 21 into fuka_btn_no
    put 3 into step21_egg
    
    littledragonmove
end if
 
if quiz_quit = 1 then
   exit eggtodragon
end if

if   step22_egg = 2 then
   put 22 into fuka_btn_no
    put 3 into step22_egg
    
    littledragonmove
end if
if   step23_egg = 2  then
   put 23 into fuka_btn_no
    put 3 into step23_egg
    
    littledragonmove
end if
if   step25_egg = 2  then
   put 25 into fuka_btn_no
    put 3 into step25_egg
    
    littledragonmove
end if
if   step26_egg = 2  then
   put 26 into fuka_btn_no
    put 3 into step26_egg
    
    littledragonmove
end if
if   step28_egg = 2  then
   put 28 into fuka_btn_no
    put 3 into step28_egg
    
    littledragonmove
end if
if   step31_egg = 2  then
   put 31 into fuka_btn_no
    put 3 into step31_egg
    
    littledragonmove
end if


if   step32_egg = 2  then
   put 32 into fuka_btn_no
    put 3 into step32_egg
    
    littledragonmove
end if
if   step34_egg = 2 then
   put 34 into fuka_btn_no
    put 3 into step34_egg
    
    littledragonmove
end if


if   step38_egg = 2  then
   put 38 into fuka_btn_no
    put 3 into step38_egg
    
    littledragonmove
end if
if   step39_egg = 2  then
   put 39 into fuka_btn_no
    put 3 into step39_egg
    
    littledragonmove
end if


if quiz_quit = 1 then
   exit eggtodragon
end if


if   step41_egg = 2  then
   put 41 into fuka_btn_no
    put 3 into step41_egg
    
    littledragonmove
end if
if   step42_egg = 2  then
   put 42 into fuka_btn_no
    put 3 into step42_egg
    
    littledragonmove
end if
if   step43_egg = 2  then
   put 43 into fuka_btn_no
    put 3 into step43_egg
    
    littledragonmove
end if
 if  step44_egg = 2  then
   put 44 into fuka_btn_no
    put 3 into step44_egg
    
    littledragonmove
end if
if   step46_egg = 2   then
   put 46 into fuka_btn_no
    put 3 into step46_egg
    
    littledragonmove
end if
if   step47_egg = 2  then
   put 47 into fuka_btn_no
    put 3 into step47_egg
    
    littledragonmove
end if
if   step49_egg = 2  then
   put 49 into fuka_btn_no
    put 3 into step49_egg
    
    littledragonmove
end if
if   step50_egg = 2   then
   put 50 into fuka_btn_no
    put 3 into step50_egg
    
    littledragonmove
end if
if   step51_egg = 2   then
   put 51 into fuka_btn_no
    put 3 into step51_egg
    
    littledragonmove
end if

end eggtodragon


On littledragonmove

repeat 2 times
if quiz_quit = 1 then
 exit repeat
end if
set bitmap of btn %fuka_btn_no% to mdragon2
wait 5 ticks
--if mouseclick()  and quizongoing = 0 then
--   click at clickh(), clickv()
--   exit littledragonmove
--end if
set bitmap of btn %fuka_btn_no% to mdragon3
wait 5 ticks
--if mouseclick() and quizongoing = 0  then
--   click at clickh(), clickv()
--   exit littledragonmove
--end if
set bitmap of btn %fuka_btn_no% to mdragon2
wait 5 ticks
--if mouseclick()  and quizongoing = 0 then
--   click at clickh(), clickv()
--   exit littledragonmove
--end if
set bitmap of btn %fuka_btn_no% to mdragon1
wait 5 ticks
--if mouseclick()  and quizongoing = 0 then
--   click at clickh(), clickv()
--   exit littledragonmove
--end if
end repeat

End littledragonmove

On randomdragonmove
put random(25) into jjj
repeat  25 times
if  step2_egg = 3 and jjj=1 then
   put 2 into fuka_btn_no
    littledragonmove
    exit repeat
end if

if   step5_egg = 3and jjj=2 then
   put 5 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step8_egg = 3 and jjj=3  then
   put 8 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step14_egg = 3 and jjj=4 then
   put 14 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if  step18_egg = 3 and jjj=5 then
   put 18 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step21_egg = 3 and jjj=6 then
   put 21 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step22_egg = 3 and jjj=7 then
   put 22 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step23_egg = 3 and jjj=8 then
   put 23 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step25_egg = 3 and jjj=9 then
   put 25 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step26_egg = 3 and jjj=10 then
   put 26 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step28_egg = 3 and jjj=11 then
   put 28 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step31_egg = 3 and jjj=12 then
   put 31 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step32_egg = 3 and jjj=13 then
   put 32 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step34_egg = 3 and jjj=14 then
   put 34 into fuka_btn_no
    littledragonmove
    exit repeat
end if


if   step38_egg = 3 and jjj=15 then
   put 38 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step39_egg = 3  and jjj=16 then
   put 39 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step41_egg = 3  and jjj=17 then
   put 41 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step42_egg = 3  and jjj=18 then
   put 42 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step43_egg = 3  and jjj=19 then
   put 43 into fuka_btn_no
    littledragonmove
    exit repeat
end if
 if  step44_egg = 3 and jjj=20  then
   put 44 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step46_egg = 3  and jjj=21 then
   put 46 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step47_egg = 3 and jjj=22 then
   put 47 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step49_egg = 3 and jjj=23 then
   put 49 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step50_egg = 3  and jjj=24 then
   put 50 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step51_egg = 3  and jjj=25 then
   put 51 into fuka_btn_no
    littledragonmove
    exit repeat
end if
put jjj + 1 into jjj
if jjj > 25 then
put 1 into jjj
end if
end repeat
end randomdragonmove





On checkroute1
put 0 into route1
if step2_egg = 0 then
   put 0 into route1
else
   put 1 into route1
end if
End checkroute1

On checkroute2
put 0 into route2
if step21_egg = 0 and step22_egg = 0 and step23_egg = 0 then
   put 0 into route2
else
   put 1 into route2
end if

End checkroute2

On checkroute3
put 0 into route3
if step18_egg = 0 then
   put 0 into route3
else
   put 1 into route3
end if

End checkroute3

On checkroute4
put 0 into route4
if step5_egg = 0 then
   put 0 into route4
else
   put 1 into route4
end if

End checkroute4

On checkroute5
put 0 into route5
if step31_egg = 0 and step32_egg = 0 then
   put 0 into route5
else
   put 1 into route5
end if

End checkroute5

On checkroute6
put 0 into route6
if step8_egg = 0  then
   put 0 into route6
else
   put 1 into route6
end if

End checkroute6

On checkroute7
put 0 into route7
if step28_egg = 0  then
   put 0 into route7
else
   put 1 into route7
end if

End checkroute7

On checkroute8
put 0 into route8
if step14_egg = 0  then
   put 0 into route8
else
   put 1 into route8
end if

End checkroute8

On checkroute9
put 0 into route9
if step25_egg = 0 and step26_egg = 0 then
   put 0 into route9
else
   put 1 into route9
end if

End checkroute9

On checkroute10
put 0 into route10
if step34_egg = 0 then
   put 0 into route10
else
   put 1 into route10
end if

End checkroute10
---------------------------
On checkroute
 if game_on is not 1 then
   exit checkroute
 end if

   put 0 into frogaction
    checkroute1
    checkroute2
    checkroute3
    checkroute4
    checkroute5
    checkroute6
    checkroute7
    checkroute8
    checkroute9
    checkroute10


if route8 = 1 and route9 = 1 and route10 = 1 then
  game_Over
  exit checkroute
end if
if frogloc = 1 or frogloc = 2 then
   if route2 = 0 or (route4 = 0 and (route5=0 or route6= 0)) and (route1 is not 1) then
     put frogloc + 1 into clickclick
     click at btn %clickclick%
     exit checkroute
    else
      if (route7 = 0) and (route5=0 or route6= 0) and (frogloc = 1 ) then
        click at btn 27
         exit checkroute      
      else
        game_Over
        exit checkroute
      end if
   end if
        game_Over
        exit checkroute
end if

-------------------------------------
if frogloc >= 20 and  frogloc <= 24 then
   if route2 = 0  or frogloc >= 23 then
     put frogloc + 1 into clickclick
      if clickclick = 25 then 
          put 11 into clickclick
          click at btn %clickclick%
          exit checkroute

       end if
         click at btn %clickclick%
          exit checkroute
     else
------------
          if frogloc= 20 and ((step21_egg is not 0) or (step22_egg is not 0) or (step23_egg is not 0)) then
               if route4 = 0 and ( route5 = 0 or route6 = 0 ) then
                 click at btn 3
                 exit checkroute

               else
                    if (route4 is not 0) and route7 =0 and ( route5 is not 0 or route6 is not 0 ) then
                           click at btn 27
                             exit checkroute      
                     else
                       game_Over
                        exit checkroute
                    end if

               end if
         end if
---------------          
        if frogloc= 21 and ( (step22_egg is not 0) or (step23_egg is not 0)) then
            if route4 = 0 and ( route5 = 0 or route6 = 0 ) then
                 click at btn 3
                 exit checkroute
             else
                  if (route4 is not 0) and route7 =0 and ( route5 is not 0 or route6 is not 0 ) then
                  click at btn 27
                     exit checkroute      
                  else
                   game_Over
                   exit checkroute
                  end if
             end if
         end if
--------------------              

      if frogloc= 22 and ( step23_egg is not 0) then
            if route4 = 0 and ( route5 = 0 or route6 = 0 ) then
                 click at btn 3
                 exit checkroute
             else
                if (route4 is not 0) and route7 =0 and ( route5 is not 0 or route6 is not 0 ) then
                  click at btn 27
                             exit checkroute      
                 else
                   game_Over
                   exit checkroute
                 end if
              end if
      end if
-----------------------
    
    end if
     put frogloc + 1 into clickclick
     click at btn %clickclick%
     exit checkroute


end if
--------------------------------------------
if frogloc >=17 and frogloc <= 19 then
   if frogloc = 17 and (step18_egg is not 0) then
        if (route1 = 0 and route2 = 0) then
             click at btn 1
             exit checkroute
         else
             if route7 = 0 and (route5 = 0 or route6 = 0 ) then
              click at btn 27
                             exit checkroute      
              end if
          end if
    else
         if route2 = 0 or ( route4 = 0 and (route5 = 0 or route6 = 0)) then
           put frogloc + 1 into clickclick
             if clickclick =20 then
                 put 3 into clickclick
               click at btn %clickclick%
               exit checkroute

               end if
                 click at btn %clickclick%
                 exit checkroute
             
          else
               if route7 = 0 and (route5 = 0 or route6 = 0 ) then
                  click at btn 27
                              exit checkroute      
               else
                  game_over
                  exit checkroute
                end if
           end if

    end if
end if

if frogloc >= 4 and frogloc <=6 then
     if frogloc = 4 and (route2 is not 0) and  (step5_egg is not 0) and (route7 = 0 and (route5 = 0 or route6 = 0)) then
        click at btn 27
        exit checkroute
     else
        if (frogloc = 6 and (step5_egg is not 0 )) and (route2 = 0 and (route1 = 0 or route3 = 0)) then
           if route1 = 0 then
              click at btn 1
             exit checkroute
            else
              click at btn 17
              exit checkroute
            end if
       end if





         if (pre_frogloc <= frogloc ) then

             if (route5 = 0 or route6 = 0) then
                 put frogloc + 1 into clickclick
                 click at btn %clickclick%
                             exit checkroute     
              else
                 if route2 = 0 and (route1 = 0 or route2 = 0 )  then
                     if route1 = 0 then 
                        click at btn 1
                             exit checkroute     
                      else
                        click at btn 17
                             exit checkroute     
                      end if
                  else
                     game_over
                              exit checkroute     
                     
                  end if
               end if
           end if
---
         if (pre_frogloc > frogloc ) then
            if route2 = 0 then
                 put frogloc - 1 into clickclick
                 click at btn %clickclick%
                             exit checkroute     
             else
                 if route5=0 or route6 = 0 then
                  put frogloc + 1 into clickclick
                  click at btn %clickclick%
                             exit checkroute     
                 else
                         game_over
                             exit checkroute     
                 end if
              end if
   
                   
          end if
          
---


     end if
end if

if frogloc = 27 or frogloc = 28 then
     if ((route5 is not 0) and (route6 is not 0) and (route4 is not 0) and (route2 = 0 )) or ( (route7 is not 0) and frogloc = 27)) then
            if route1 = 0 then
               click at btn 1
                             exit checkroute      
             else
                 if route3 = 0 then
                     click at btn 17
                             exit checkroute      
                  end if
             end if
else
      put frogloc +1 into clickclick
      if clickclick = 29 then 
           put 7 into clickclick
      end if
      click at btn %clickclick%
     exit checkroute
end if
end if

if frogloc >=8 and frogloc <= 10 then
    put frogloc + 1 into clickclick
      click at btn %clickclick%
     exit checkroute
 end if

if frogloc >=29 and frogloc <= 32 then
    if( (frogloc= 29 or frogloc = 30) and ((step31_egg is not 0) or(step30_egg is not 0))) or (frogloc = 31 and (step32_egg is not 0)) then
         if (route4 = 0 and route2 = 0) then 
              click at btn 7
            exit checkroute
          else
              if route2 = 0 and rout1 = 0 then
                 click at btn 1
                             exit checkroute      
              else
                    if route2 = 0 and route3 = 0 then
                      click at btn 17
                                exit checkroute      
                    else
                      game_over
                      exit checkroute 
                     end if
               exit checkroute
              end if
          end if
 else
       put frogloc + 1 into clickclick
       if clickclick = 33 then
             put 11 into clickclick
        end if
        click at btn %clickclick%
        exit checkroute
 end if

end if

If frogloc >= 12 and frogloc <= 14 then
      if (route8 is not 0) and (frogloc= 12 or frogloc = 13)) then
            click at btn 11
                             exit checkroute      
      else
            put frogloc + 1 into clickclick
            click at btn %clickclick%
                             exit checkroute      
       end if
end if

If frogloc = 25 then
   if step26_egg is not 0 then
       click at btn 11
                             exit checkroute      
    else
      click at btn 26
                             exit checkroute      
    end if
end if

if frogloc >=33 and frogloc <=34 then
      if frogloc = 33 and (step34_egg is not 0) then
          click at btn 11
                             exit checkroute      
      else
          put frogloc + 1 into clickclick
          click at btn %clickclick%
                             exit checkroute      
       end if
end if






if frogloc = 11 then
  put random(3) into n

  if n=1 then

    if route10 = 0 then
       click at btn 33
                             exit checkroute     
    else
       if  route9 = 0 then
          click at btn 25
                             exit checkroute      
       else
          if route8 = 0 then
           click at btn 12
                             exit checkroute      
             end if
                 
                        
           end if
        end if


 end if



  if n=2 then

    if route8 = 0 then
       click at btn 12
                             exit checkroute     
    else
       if  route9 = 0 then
          click at btn 25
                             exit checkroute      
       else
          if route10 = 0 then
           click at btn 33
                             exit checkroute      
           end if
        end if
     end if


 end if


  if n=3 then
       if  route9 = 0 then
          click at btn 25

                             exit checkroute     
        else
            if route8 = 0 then
                 click at btn 12
                             exit checkroute      
           else
             if route10 = 0 then
               click at btn 33
                             exit checkroute      
           end if
        end if
     end if


 end if




      game_over
      exit checkroute      












end if








if frogloc = 3 then
    if route2 = 0 then
       click at btn 20
       exit checkroute
    else
       if route4 = 0  and ( route5 = 0 or route6 = 0 ) then
         click at btn 4
         exit checkroute
        else
           if route7 = 0 and ( route5 = 0 or route6 = 0 ) then
              click at btn 27
              exit checkroute
            else
              game_over
              exit checkroute
            end if
         end if
     end if
end if

If frogloc = 7 then
     if route6 = 0 then
        click at btn 8
                             exit checkroute      
     else
        if route5 = 0 then 
             click at btn 29
                              exit checkroute      
        else
             if route2 is not 0  then
                game_over
                exit checkroute
            else
                if route4 = 0 then
                    click at btn 6
                                 exit checkroute      
             else
                      if route1 = 0 then
                          click at btn 1
                             exit checkroute      
                      else
                              if route3 = 0 then
                                   click at btn 17
                               exit checkroute      
                            else
                                game_Over
                                exit checkroute

                               end if
                       end if
                  end if
                   game_Over
                   exit checkroute
              end if
                        
           end if
      end if

end if
----
        game_Over
        exit checkroute

---------
End checkroute


----------------------------


On game_Over
play uhoohhh
lock screen
show btn wichback
set bitmap of btn witch1 to witch1
set loc of btn witch1 to locH of btn wichback, locV of btn wichback
unlock screen
wait 200 ticks
play madwoman

witchanime2
wait 1 seconds
play Beethovn
exitkingdom
exit game_over

End game_Over

On game_Over2
play uhoohhh
set bitmap of btn witch1 to witch1
wait 30 ticks
set bitmap of btn witch1 to witchspr
wait 170 ticks
play Beethovn
exitkingdom
exit game_over2

End game_Over2

-------------- end card 3 -----------------


--------------  card 33 ---------
On q_clock33_hard
put random(720) into clock33
Setclock33
 if game_on is  1 and init33 = 0 then
  play imananji
   put 3 into ntx
   naratoranimex
 put 1 into init33
  end if
  put random(5) into moreorless
 put 0 into quiz_quit
 
  if moreorless = 1 then
       if clock33 + 165  < 720 then
          put clock33 + 165 into ans33 
          QuizDlg18 "2 hrs 45 min. from now will be  __ (to/past)__", ans33
        else
          put clock33 - 165 into ans33 
          QuizDlg18 "2 hrs 45 min. before now was __ (to/past)__", ans33
      end if
  end if
  if moreorless = 2 then
       if clock33 + 135  < 720 then
          put clock33 + 135 into ans33 
          QuizDlg18 "2 hrs 15 min. from now will be  __( to/past)__", ans33
     else
          put clock33 - 135 into ans33 
          QuizDlg18 "2 hrs 15 min. before now was  __(to/past)__", ans33
        end if
  end if
  if moreorless = 3 then
       if clock33 + 90  < 720 then
          put clock33 + 90 into ans33 
          QuizDlg18 "1 hr and a half from now will be  __(to/past)__", ans33
    else
          put clock33 - 90 into ans33 
          QuizDlg18 "1 hr and a half before now was  __(to/past)__", ans33
    end if
  end if
  if moreorless = 4 then
       if clock33 + 70  < 720 then
          put clock33 + 70 into ans33 
          QuizDlg18 "1 hr 10 min. from now will be  __(to/past)__", ans33
    else
          put clock33 - 70 into ans33 
          QuizDlg18 "1 hr 10 min. before now was  __(to/past)__", ans33
    end if
  end if
  if moreorless = 5 then
       if clock33 + 35  < 720 then
          put clock33 + 35 into ans33 
          QuizDlg18 "35 min. from now will be __(to/past)__", ans33
    else
          put clock33 - 35 into ans33 
          QuizDlg18 "35 min. before now was  __(to/past)__", ans33
    end if
  end if
 
      repeat while quiz_quit = 0
         wait 30 ticks
      end repeat
--      put 0 into quiz_quit
  if math_answer is not 1 then
         if math_answer is  -1 then
          play  uhoh2
          else
              play jawharp
              showwitch_surprised
          end if
       else
           play good
           show_frog_good
      end if

End q_clock33_hard



---------------------

On opencard 33
  put 33 into presentcard
  put 0 into init33
if game_on is not 1 then
  play imananji
   put 3 into ntx
   naratoranimex
  wait 1 seconds
  play bokuwo
   put 4 into ntx
   naratoranimex

end if

    put 0 into clock33
	SetClock33


end opencard

On q_clock33
put random(720) into clock33
Setclock33
 if game_on is  1 and init33 = 0 then
  play imananji
   put 3 into ntx
   naratoranimex
 put 1 into init33
  end if

  QuizDlg18 "What time is it now? It is  __ minute(s)(to/past) __", clock33
      repeat while quiz_quit = 0
         wait 30 ticks
      end repeat
      put 0 into quiz_quit
  if math_answer is not 1 then
         if math_answer is  -1 then
          play  uhoh2
          else
              play jawharp
              showwitch_surprised
          end if
       else
           play good
           show_frog_good
      end if

End q_clock33







On SetClock33
	put clock33 mod 60 into fun
	set data of btn "PinLong" to fun * 6
	set data of btn "PinShort" to clock33 * 0.5
end SetClock33

On FunUp33
	repeat while mouse() is down
		put clock33 + 1 into clock33
		if clock33 >= 720 then
			put clock33 - 720 into clock33
		end if
		SetClock33
		wait 10 ticks
	end repeat
end FunUp33

On FunDown33
	repeat while mouse() is down
		put clock33 - 1 into clock33
		if clock33 < 0 then
			put clock33 + 720 into clock33
		end if
		SetClock33
		wait 10 ticks
	end repeat
end FunDown33

On JikanUp33
	repeat while mouse() is down
		put clock33 + 60 into clock33
		if clock33 >= 720 then
			put clock33 - 720 into clock33
		end if
		SetClock33
		wait 10 ticks
	end repeat
end JikanUp33

On JikanDown33
	repeat while mouse() is down
		put clock33 - 60 into clock33
		if clock33 < 0 then
			put clock33 + 720 into clock33
		end if
		SetClock33
		wait 10 ticks
	end repeat
end JikanDown33

-------------- end card 33 ---------
--------------  card 35 ---------

On OpenCard 35
if game_on is not 1 then
  play nanjikan
  put 3 into ntx
  naratoranimex
  wait 1 seconds
  play bokuwo
   put 4 into ntx
  naratoranimex

 end if
   put 0 into init35
   put 0 into clock35_1
   put 0 into clock35_2

	SetClock35
end OpenCard

On q_clock35
put random(720) into clock35_1
put random(720) into clock35_2
Setclock35

 if game_on is  1 and init35 = 0 then
  play nanjikan
  put 3 into ntx
  naratoranimex
 put 1 into init35
  end if


 if clock35_1 >= clock35_2 then

put (clock35_1 - clock35_2) into difference 
  QuizDlg7 "The yellow clock is __hrs__min faster than the purple clock", difference
 else
 put (clock35_2 - clock35_1) into difference 
  QuizDlg7 "The purple clock is __hrs__min faster than the yellow clock", difference
end if
     repeat while quiz_quit = 0
         wait 30 ticks
      end repeat
      put 0 into quiz_quit
  if math_answer is not 1 then
         if math_answer is  -1 then
             play  uhoh2
          else
              play jawharp
             showwitch_surprised
          end if
       else
           play good
           show_frog_good
      end if


End q_clock35



On SetClock35
	put clock35_1 mod 60 into fun
	set data of btn "PinLong1" to fun * 6
	set data of btn "PinShort1" to clock35_1 * 0.5

	put clock35_2 mod 60 into fun
	set data of btn "PinLong2" to fun * 6
	set data of btn "PinShort2" to clock35_2 * 0.5
end SetClock35

On FunUp35_1
	repeat while mouse() is down
		put clock35_1 + 1 into clock35_1
		if clock35_1 >= 720 then
			put clock35_1 - 720 into clock35_1
		end if
		SetClock35
		wait 10 ticks
	end repeat
end FunUp35_1

On FunDown35_1
	repeat while mouse() is down
		put clock35_1 - 1 into clock35_1
		if clock35_1 < 0 then
			put clock35_1 + 720 into clock35_1
		end if
		SetClock35
		wait 10 ticks
	end repeat
end FunDown35_1

On JikanUp35_1
	repeat while mouse() is down
		put clock35_1 + 60 into clock35_1
		if clock35_1 >= 720 then
			put clock35_1 - 720 into clock35_1
		end if
		SetClock35
		wait 10 ticks
	end repeat
end JikanUp35_1

On JikanDown35_1
	repeat while mouse() is down
		put clock35_1 - 60 into clock35_1
		if clock35_1 < 0 then
			put clock35_1 + 720 into clock35_1
		end if
		SetClock35
		wait 10 ticks
	end repeat
end JikanDown35_1

On FunUp35_2
	repeat while mouse() is down
		put clock35_2 + 1 into clock35_2
		if clock35_2 >= 720 then
			put clock35_2 - 720 into clock35_2
		end if
		SetClock35
		wait 10 ticks
	end repeat
end FunUp35_2

On FunDown35_2
	repeat while mouse() is down
		put clock35_2 - 1 into clock35_2
		if clock35_2 >= 720 then
			put clock35_2 - 720 into clock35_2
		end if
		SetClock35
		wait 10 ticks
	end repeat
end FunDown35_2

On JikanUp35_2
	repeat while mouse() is down
		put clock35_2 + 60 into clock35_2
		if clock35_2 >= 720 then
			put clock35_2 - 720 into clock35_2
		end if
		SetClock35
		wait 10 ticks
	end repeat
end JikanUp35_2

On JikanDown35_2
	repeat while mouse() is down
		put clock35_2 - 60 into clock35_2
		if clock35_2 < 0 then
			put clock35_2 + 720 into clock35_2
		end if
		SetClock35
		wait 10 ticks
	end repeat
end JikanDown35_2

-------------- end card 35---------














--------------------card 42 -----------------
On opencard 42
  put 42 into presentcard
  if game_on is not 1 then
  play x99
   put 3 into ntx
   naratoranimex
wait 1 seconds
  play bokuwo
   put 5 into ntx
   naratoranimex
  put 0 into x99selectedcolumn
  end if

end opencard

On random_selection_of_column
put random(19) into x99_number_random
if x99_number_random = 10 then
  put random(9) into x99_number_random
end if
if x99_number_random = 1 then
  hx1
end if
if x99_number_random = 2 then
  hx2
end if
if x99_number_random = 3 then
  hx3
end if
if x99_number_random = 4 then
  hx4
end if
if x99_number_random = 5 then
  hx5
end if
if x99_number_random = 6 then
  hx6
end if
if x99_number_random = 7 then
  hx7
end if
if x99_number_random = 8 then
  hx8
end if
if x99_number_random = 9 then
  hx9
end if
if x99_number_random = 11 then
  v1x
end if
if x99_number_random = 12 then
  v2x
end if
if x99_number_random = 13 then
  v3x
end if

if x99_number_random = 14 then
  v4x
end if

if x99_number_random = 15 then
  v5x
end if

if x99_number_random = 16 then
  v6x
end if

if x99_number_random = 17 then
  v7x
end if

if x99_number_random = 18 then
  v8x
end if

if x99_number_random = 19 then
  v9x
end if


End random_selection_of_column






On hx1
lock screen
vhbarhide
set the loc of btn x99v1 to 107,249
show btn x99v1
unlock screen
put 1 into x99selectedcolumn
end hx1

On hx3
lock screen
vhbarhide
set the loc of btn x99v1 to 107 + 71 * 1,249
show btn x99v1
unlock screen
put 3 into x99selectedcolumn
end hx3

On hx5
lock screen
vhbarhide
set the loc of btn x99v1 to 107 + 71 * 2,249
show btn x99v1
unlock screen
put 5 into x99selectedcolumn
end hx5

On hx7
lock screen
vhbarhide
set the loc of btn x99v1 to 107 + 71 * 3 - 1, 249
show btn x99v1
unlock screen
put 7 into x99selectedcolumn
end hx7

On hx9
lock screen
vhbarhide
set the loc of btn x99v1 to 107 + 71 * 4 - 2,249
show btn x99v1
unlock screen
put 9 into x99selectedcolumn
end hx9

---------------------

On hx2
lock screen
vhbarhide
set the loc of btn x99v2 to 143 ,249
show btn x99v2
unlock screen
put 2 into x99selectedcolumn
end hx2

On hx4
lock screen
vhbarhide
set the loc of btn x99v2 to 143 + 71 * 1 ,249
show btn x99v2
unlock screen
put 4 into x99selectedcolumn
end hx4

On hx6
lock screen
vhbarhide
set the loc of btn x99v2 to 143 + 71 * 2 ,249
show btn x99v2
unlock screen
put 6 into x99selectedcolumn
end hx6

On hx8
lock screen
vhbarhide
set the loc of btn x99v2 to 143 + 71 * 3 ,249
show btn x99v2
unlock screen
put 8 into x99selectedcolumn
end hx8

-----------------------------
On v1x
lock screen
vhbarhide
set the loc of btn x99h1 to 249, 110
show btn x99h1
unlock screen
put 11 into x99selectedcolumn
end v1x

On v3x
lock screen
vhbarhide
set the loc of btn x99h1 to 249, 110 + 71 * 1
show btn x99h1
unlock screen
put 13 into x99selectedcolumn
end v3x

On v5x
lock screen
vhbarhide
set the loc of btn x99h1 to 249, 110 + 71 * 2
show btn x99h1
unlock screen
put 15 into x99selectedcolumn
end v5x

On v7x
lock screen
vhbarhide
set the loc of btn x99h1 to 249, 110 + 71 * 3 - 1
show btn x99h1
unlock screen
put 17 into x99selectedcolumn
end v7x

On v9x
lock screen
vhbarhide
set the loc of btn x99h1 to 249, 110 + 71 * 4 - 3
show btn x99h1
unlock screen
put 19 into x99selectedcolumn
end v9x

On v2x
lock screen
vhbarhide
set the loc of btn x99h2 to 249, 143
show btn x99h2
unlock screen
put 12 into x99selectedcolumn
end v2x

On v4x
lock screen
vhbarhide
set the loc of btn x99h2 to 249 + 1, 143 + 71 * 1
show btn x99h2
unlock screen
put 14 into x99selectedcolumn
end v4x

On v6x
lock screen
vhbarhide
set the loc of btn x99h2 to 249, 143 + 71 * 2
show btn x99h2
unlock screen
put 16 into x99selectedcolumn
end v6x

On v8x
lock screen
vhbarhide
set the loc of btn x99h2 to 249, 143 + 71 * 3
show btn x99h2
unlock screen
put 18 into x99selectedcolumn
end v8x

On vhbarhide
hide btn x99v1
hide btn x99v2
hide btn x99h1
hide btn x99h2
End vhbarhide



On q_multiplication
if  x99selectedcolumn = 0 then
    show btn t_writer
       message2 289, 31, 9, "Select a row or a column on the 9x9 board first!"
    hide btn t_writer
   exit q_multiplication
end if
   if x99selectedcolumn < 10 then
       put 107 + 35 * ( x99selectedcolumn -1 ) into qmrkx
       put x99selectedcolumn into x_value
       put random( 9) into y_value
       put 110 + 35 * ( y_value -1 ) into qmrky
   else
       put x99selectedcolumn - 10 into y_value
       put random(9) into x_value
       put 107 + 35 * ( x_value - 1 ) into qmrkx
       put 110 + 35 * ( y_value  -1 ) into qmrky
   end if
    set the loc of btn x99qmrkr to qmrkx, qmrky
    repeat 4 times
    show btn x99qmrkr
    play click
    wait 10 ticks
    hide btn x99qmrkr
    end repeat
    show btn x99qmrkr
 put 0 into quiz_quit
 
   put  x_value * y_value into x99ans
    QuizDlg4 "What number do you expect?", x99ans
 
      repeat while quiz_quit = 0
         wait 30 ticks
      end repeat
-- put 0 into quiz_quit
 
  if math_answer is not 1 then
        if math_answer is  -1 then
            play  uhoh2
        else
            play jawharp
          showwitch_surprised
         end if
       else
           play good
           show_frog_good
      end if

    hide btn x99qmrkr
End  q_multiplication

On q_multi5
    put 0 into q5_score
     repeat 5 times
           random_selection_of_column
           q_multiplication
      if math_answer is not 1 then
           if math_answer = -1 then
              exit q_multi5
            end if

        else
          put q5_score +1 into q5_score
       end if
   end repeat

if q5_score = 5 then
   play fanfar2
   wait 5 seconds
   ok100
end if
if q5_score = 4 then
   play fanfar2
   wait 5 seconds
  ok80
end if
if q5_score = 3 then
   play fanfar2
   wait 5 seconds
  ok60
end if
if q5_score = 2 or q5_score = 1 or q5_score = 0  then
   play Uhoohhh
   wait 2 seconds
end if
   

End q_multi5






-------------------end card 42 ----------


On Entranceback
play uhoohhh
wait 150 ticks
put random(3) into rdmback
if rdmback = 1 then
  put 27 into frogloc
end if
if rdmback = 2 then
  put 17  into frogloc
end if
if rdmback = 3 then
  put 1 into frogloc
end if
click at btn %frogloc%
exit entranceback
End Entranceback


On M_KingdomTours

if grade_level = 0 then
  put  7 into  top_pos_x
  getcdtogo
end if

if grade_level = 1 then
  put  11 into  top_pos_x
  getcdtogo
end if

if grade_level = 2 then
  put  14  into  top_pos_x
  getcdtogo
 end if

if selectedcardtogo = 1 then
  dblqandwait
 show btn t_writer
  message2 141, 28, 9, "If you fail to solve the question, you will be returned to the entrance!"
hide btn t_writer
     go cd 34
GameStart2
   if math_answer is not 1 then
          go cd 3
          if math_answer = -1 then
            game_over2
            exit M_KingdomTours

           end if
          entranceback
   exit M_KingdomTours
   end if
end if

if selectedcardtogo = 2 then

  dblqandwait
 show btn t_writer
  message2 141, 28, 9, "If you fail to solve the question, you will be returned to the entrance!"
hide btn t_writer
  go cd 31
  GameStart2
   if math_answer is not 1 then
           go cd 3
          if math_answer = -1 then
            game_over2
            exit M_KingdomTours

           end if
          entranceback
     exit M_KingdomTours
   end if
end if

if selectedcardtogo = 3 then
  dblqandwait
show btn t_writer
 message2 141, 28, 9, "If you fail to solve the question, you will be returned to the entrance!"
hide btn t_writer

  go cd 33
  repeat 2 times
   q_clock33
   if math_answer is not 1 then
           go cd 3
          if math_answer = -1 then
            game_over2
            exit M_KingdomTours

           end if
          entranceback
     exit M_KingdomTours
   end if
  end repeat

end if




if selectedcardtogo = 4 then
  dblqandwait
show btn t_writer
 message2 141, 28, 9, "If you fail to solve the question, you will be returned to the entrance!"
hide btn t_writer
  go cd 42
  repeat 2 times
       random_selection_of_column
       q_multiplication
      if math_answer is not 1 then
             go cd 3
          if math_answer = -1 then
            game_over2
            exit M_KingdomTours

           end if
           entranceback
     exit M_KingdomTours
    end if
   end repeat

end if





if selectedcardtogo = 5 then
--  dblqandwait
show btn t_writer
 message2 141, 28, 9, "If you fail to solve the question, you will be returned to the entrance!"
hide btn t_writer
  go cd 101
  gamestart
      if math_answer is not 1 then
             go cd 3
          if math_answer = -1 then
            game_over2
            exit M_KingdomTours

           end if
           entranceback
     exit M_KingdomTours
    end if

end if


if selectedcardtogo = 6 then
--  dblqandwait
show btn t_writer
 message2 141, 28, 9, "If you fail to solve the question, you will be returned to the entrance!"
hide btn t_writer
  go cd 102
  gamestart
      if math_answer is not 1 then
             go cd 3
          if math_answer = -1 then
            game_over2
            exit M_KingdomTours

           end if
           entranceback
     exit M_KingdomTours
    end if

end if



if selectedcardtogo = 7 then
dblqandwait
show btn t_writer
 message2 141, 28, 9, "If you fail to solve the question, you will be returned to the entrance!"
hide btn t_writer
  go cd 46
  quizbargraph_2
      if math_answer is not 1 then
             go cd 3
          if math_answer = -1 then
            game_over2
            exit M_KingdomTours

           end if
           entranceback
     exit M_KingdomTours
    end if

end if












if selectedcardtogo = 8 then
  dblqandwait
show btn t_writer
 message2 141, 28, 9, "If you fail to solve the question, you will be returned to the entrance!"
hide btn t_writer

  go cd 32
     Game32_2
     if math_answer is not 1 then
           go cd 3
          if math_answer = -1 then
            game_over2
            exit M_KingdomTours

           end if
          entranceback
     exit M_KingdomTours
     end if


end if


if selectedcardtogo = 9 then
 
show btn t_writer
message2 141, 28, 9, "If you fail to solve the question, you will be returned to the entrance!"
hide btn t_writer
  go cd 36

quiz36
   if math_answer is not 1 then
           go cd 3
          if math_answer = -1 then
            game_over2
            exit M_KingdomTours

           end if
         entranceback
     exit M_KingdomTours
   end if

end if

if selectedcardtogo = 10 then
  dblqandwait
show btn t_writer
message2 141, 28, 9, "If you fail to solve the question, you will be returned to the entrance!"
hide btn t_writer
  go cd 37
  repeat 2 times
    howtomeasure123
   if math_answer is not 1 then
           go cd 3
          if math_answer = -1 then
            game_over2
            exit M_KingdomTours

           end if
           entranceback
     exit M_KingdomTours
   end if
   end repeat

end if

if selectedcardtogo = 11 then
  dblqandwait
show btn t_writer
 message2 141, 28, 9, "If you fail to solve the question, you will be returned to the entrance!"
hide btn t_writer
  go cd 44

Quiz44_2
      if math_answer is not 1 then
             go cd 3
          if math_answer = -1 then
            game_over2
            exit M_KingdomTours

           end if
           entranceback
     exit M_KingdomTours
    end if

end if


if selectedcardtogo = 12 then
  dblqandwait
show btn t_writer
message2 141, 28, 9, "If you fail to solve the question, you will be returned to the entrance!"
 hide btn t_writer
  go cd 35
  repeat 2 times
   q_clock35
   if math_answer is not 1 then
          go cd 3
          if math_answer = -1 then
            game_over2
            exit M_KingdomTours

           end if
           entranceback

     exit M_KingdomTours
   end if
  end repeat

end if


if selectedcardtogo = 13 then
 
show btn t_writer
message2 141, 28, 9, "If you fail to solve the question, you will be returned to the entrance!"
hide btn t_writer
  go cd 36
put random(5) into r36
put random(5) into s36
repeat r36 times
 changebacket
end repeat
repeat s36 times
 changeknob
end repeat

quiz36
   if math_answer is not 1 then
           go cd 3
          if math_answer = -1 then
            game_over2
            exit M_KingdomTours

           end if
         entranceback
     exit M_KingdomTours
   end if

end if




if selectedcardtogo = 14 then
  dblqandwait
show btn t_writer
message2 141, 28, 9, "If you fail to solve the question, you will be returned to the entrance!"
 hide btn t_writer
  go cd 45

Quiz45_2
     if math_answer is not 1 then
          go cd 3
          if math_answer = -1 then
            game_over2
            exit M_KingdomTours

           end if
           entranceback
        exit M_KingdomTours
      end if
end if

 go cd 3
exit  M_KingdomTours

End M_KingdomTours






On OK100
    set loc of btn t_writer to 368, 69
    show btn t_writer
  message2 289, 31, 9, "Congratulations! Your answers are 100% correct!"
  hide btn t_writer
End OK100
On OK80
   set loc of btn t_writer to 368, 69
     show btn t_writer
  message2 289, 31, 9, "Congratulations! Your answers are 80% correct!""
  hide btn t_writer
End OK80

On OK60
   set loc of btn t_writer to 368, 69
     show btn t_writer
  message2 289, 31, 9, "Congratulations! Your answers are 60% correct!""
  hide btn t_writer
End OK60

On dblqandwait
play dblquiz
wait 120 ticks
End dblqandwait


On getcdtogo

put random( top_pos_x ) into ctj
repeat top_pos_x times
 if Item ctj of checkcardlist = minimum_level then
     put ctj into selectedcardtogo
     put Item ctj of checkcardlist + 1 into Item ctj of checkcardlist
    exit getcdtogo
 else
    put ctj + 1 into ctj
 end if
   if  ctj > top_pos_x then
       put 1 into  ctj
   end if
 end repeat
   put minimum_level + 1 into minimum_level
   put random( top_pos_x ) into ctj
   put ctj into selectedcardtogo
  put Item ctj of checkcardlist + 1 into Item ctj  of checkcardlist

End getcdtogo


On gocd3
go cd 3
End gocd3



On gocd4
go cd 4
End gocd4

On gocd32
go cd 32
End gocd32

On gocd39
go cd 39
End gocd39

On gocd36
go cd 36
End gocd36

On gocd42
go cd 42
End gocd42

On gocd41
go cd 41
End gocd41

On gocd40
go cd 40
End gocd40

On gocd33
go cd 33
End gocd33

On gocd35
go cd 35
End gocd35

On gocd37
go cd 37
End gocd37

On gocd30
go cd 30
End gocd30

On gocd31
go cd 31
End gocd31

On gocd10
go cd 10
End gocd10

On gocd11
go cd 11
End gocd11

On gocd13
go cd 13
End gocd13

On gocd17
go cd 17
End gocd17

On gocd44
go cd 44
End gocd44

On gocd45
go cd 45
End gocd45

On gocd46
go cd 46
End gocd46

On gocd34
go cd 34
End gocd34

On gocd100
go cd 100
End gocd100

On gocd99
go cd 99
End gocd99

On gocd101
go cd 101
End gocd101


On gocd102
go cd 102
End gocd102


On gocd103
go cd 103
End gocd103


On gocd104
go cd 104
End gocd104


On gocd105
go cd 105
End gocd105


On gocd106
go cd 106
End gocd106


On gocd107
go cd 107
End gocd107


On gocd108
go cd 108
End gocd108




On Sansu_owaru
 quit
End Sansu_owaru

On erase_sound
	SoundOnOff
End erase_sound

-------------------------- card 4 ---------------

On idle 4
put random(15) into rdm4
if random(30) = 5  then
  idle_anime_baloon
end if

if random(35) = 7  then
  idle_anime_bee
end if

if rdm4 = 9  then
  idle_anime_oct
end if

if rdm4 = 11  then
  idle_anime_frg
end if

if rdm4 = 13  then
  idle_anime_clock
end if

if rdm4 = 14 then
  idle_flagmth_change
end if






End idle



On idle_anime_baloon
set the loc of btn baloon  to 625, 105
show btn baloon
soundrandom
repeat with idle4x = 1 to 60
  put random(5) into idle4y
  if idle4x < 15 then
     put 105 - 2 * idle4x into nnnn
  else
     if idle4x = 15 then
          put nnnn into yyyy
     else
         if idle4x < 30  then
             put yyyy + 3 * idle4x   into nnnn
          else
              if idle4x = 30 then
                 put nnnn into yyyy
              else
                  put yyyy - 2 * (idle4x - 30 )  into nnnn
              end if
          end if

      end if
  end if

  set the loc of btn baloon to 625 - 10 * idle4x, nnnn - idle4y
  wait 5 ticks
  if mouseclick() then
    play click
    go cd 3
   exit idle_anime_baloon
  end if
  
end repeat
 hide btn baloon

End idle_anime_baloon


On idle_anime_bee
set the loc of btn bee_lfts  to 576, 380
show btn bee_lfts
play bee
repeat with idle4x = 1 to 57
  put random(10) into idle4y
  put random(10) into xx4
  set the loc of btn bee_lfts to 576 - 10 * idle4x + xx4, 380 - 5 * idle4x - idle4y
  wait 5 ticks
  if mouseclick() then
   exit repeat
  end if
  
end repeat

set the loc of btn bee_lfts  to 576, 380

End idle_anime_bee

On idle_anime_oct
play ocean
repeat with idle4x = 1 to 3
  set bitmap of btn oct0 to oct2
    wait 10 ticks
  set bitmap of btn oct0 to oct1
    wait 10 ticks
  if mouseclick() then
   exit repeat
  end if
end repeat
   set bitmap of btn oct0 to oct0
 

End idle_anime_oct

On idle_anime_frg
play frog
repeat with idle4x = 1 to 3
  set bitmap of btn frg1 to frg2
    wait 10 ticks
  set bitmap of btn frg1 to frg1
    wait 10 ticks
  if mouseclick() then
   exit repeat
  end if
end repeat
   set bitmap of btn frg1 to frg1
 

End idle_anime_frg

On idle_anime_clock
play clock2
repeat with idle4x = 1 to 2
  set bitmap of btn clock1 to clock2
    wait 10 ticks
  if mouseclick() then
   exit repeat
  end if
  set bitmap of btn clock1 to clock3
    wait 10 ticks
  if mouseclick() then
   exit repeat
  end if
  set bitmap of btn clock1 to clock2
    wait 10 ticks
  if mouseclick() then
   exit repeat
  end if
  set bitmap of btn clock1 to clock1
    wait 20 ticks
  if mouseclick() then
   exit repeat
  end if
end repeat
   set bitmap of btn clock1 to clock1
 

End idle_anime_clock



On   idle_flagmth_change
play windx
repeat 4 times
set bitmap of btn flagmthg to flagmthh
wait 1 ticks
set bitmap of btn flagmthg to flagmthg
wait 1 ticks
end repeat
End   idle_flagmth_change

----------------------------- end card 4 ------------------



On Allcard_q5

put 0 into q5_score
if presentcard = 40 then
 
 repeat 5 times
    howmanycandy10
   if math_answer is not 1 then
      if math_answer = -1 then
          exit Allcard_q5
      end if
 
   else
    put q5_score +1 into q5_score
   end if
  end repeat

end if


if presentcard = 32 then
  repeat 5 times
    makeorder
   if math_answer is not 1 then
      if math_answer = -1 then
          exit Allcard_q5
      end if
 
   else
    put q5_score +1 into q5_score
   end if
   end repeat
end if


if presentcard = 33 then
  repeat 5 times
   q_clock33
     if math_answer is not 1 then
      if math_answer = -1 then
          exit Allcard_q5
      end if
 
   else
    put q5_score +1 into q5_score
   end if
 end repeat

end if

if presentcard = 41 then
 
  repeat 5 times
    howmanycandy100
     if math_answer is not 1 then
      if math_answer = -1 then
          exit Allcard_q5
      end if
 
   else
    put q5_score +1 into q5_score
   end if
 end repeat

end if

if presentcard = 37 then
      repeat 5 times
         howtomeasure123
   if math_answer is not 1 then
      if math_answer = -1 then
          exit Allcard_q5
      end if
 
   else
    put q5_score +1 into q5_score
   end if
   end repeat

end if

if presentcard = 42 then
     repeat 5 times
           random_selection_of_column
           q_multiplication
   if math_answer is not 1 then
      if math_answer = -1 then
          exit Allcard_q5
      end if
 
   else
    put q5_score +1 into q5_score
   end if

   end repeat

end if

if presentcard = 39 then
   repeat 5 times
   put random(4) into rdmlives
   if rdmlives = 1 then
        bird2_chosen
   end if
   if rdmlives = 2 then
       octpus_chosen
   end if
   if rdmlives = 3 then
       Zebra_chosen
   end if
   if rdmlives = 4 then
       Ladybugs_chosen
   end if

   if math_answer is not 1 then
      if math_answer = -1 then
          play uhoh2
          exit Allcard_q5
      end if
 
   else
    put q5_score +1 into q5_score
   end if
  end repeat
end if

if q5_score = 5 then
   play fanfar2
   wait 5 seconds
   ok100
end if
if q5_score = 4 then
   play fanfar2
   wait 5 seconds
  ok80
end if
if q5_score = 3 then
   play fanfar2
   wait 5 seconds
  ok60
end if
if q5_score = 2 or q5_score = 1 or q5_score = 0  then
   play Uhoohhh
   wait 2 seconds
end if
   

End Allcard_q5

on polygon
Omath Menu Polygon
end polygon


on pie
Omath Menu Sector
end pie


on colorit
Omath Menu ColorIt
end colorit






on colorit
Omath Menu ColorIt
end color it

On Oprint
OMath Menu Print

end Oprint


on file_omath
Omath Menu File
end file_omath

on plot_a_point
OMath Menu Plotapoint
end plot_a_point

on draw_line_with_2dots
OMath Menu LineSegment
end draw_line_with_2dots
on draw_vline
OMath Menu VerticalLine
end draw_vline
on draw_parallel_line
OMath Menu ParallelLine
end draw_parallel_line
on draw_circle_given_rad
OMath Menu Circle_radius
end draw_circle_given_rad
on hide_dot_line
OMath Menu Show/Hide
end hide_dot_line
on undo_operation
OMath Menu Undo
end undo_operation
on label_attach
OMath Menu Label
end label_attach
on set_commenting
OMath Menu Commenting
end set_commenting
on email_omath
OMath Mail

end email_omath

On move_object
OMath Menu Move
end move_object

On find_length
OMath Menu Length
End find_length

On find_angle
OMath Menu AngleSize
End find_angle

On erasing
OMath Menu Erase
End erasing

On point_intersection
OMath Menu Pointofintersection
End point_intersection





On All_Refreshed
lock screen
put step2_egg into egg_cond_number

put 2 into target_egg
refreshegg
put step5_egg into egg_cond_number
put 5 into target_egg
refreshegg
put step8_egg into egg_cond_number
put 8 into target_egg
refreshegg
put step14_egg into egg_cond_number
put 14 into target_egg
refreshegg
put step18_egg into egg_cond_number
put 18 into target_egg
refreshegg
put step21_egg into egg_cond_number
put 21 into target_egg
refreshegg
put step22_egg into egg_cond_number
put 22 into target_egg
refreshegg
put step23_egg into egg_cond_number
put 23 into target_egg
refreshegg
put step25_egg into egg_cond_number
put 25 into target_egg
refreshegg
put step26_egg into egg_cond_number
put 26 into target_egg
refreshegg
put step28_egg into egg_cond_number
put 28 into target_egg
refreshegg
put step31_egg into egg_cond_number
put 31 into target_egg
refreshegg
put step32_egg into egg_cond_number
put 32 into target_egg
refreshegg
put step34_egg into egg_cond_number
put 34 into target_egg
refreshegg
--------------------------------------------------
put step38_egg into egg_cond_number

put 38 into target_egg
refreshegg
put step39_egg into egg_cond_number
put 39 into target_egg
refreshegg
put step41_egg into egg_cond_number
put 41 into target_egg
refreshegg
put step42_egg into egg_cond_number
put 42 into target_egg
refreshegg
put step43_egg into egg_cond_number
put 43 into target_egg
refreshegg
put step44_egg into egg_cond_number
put 44 into target_egg
refreshegg
put step45_egg into egg_cond_number
put 45 into target_egg
refreshegg
put step46_egg into egg_cond_number
put 46 into target_egg
refreshegg
put step47_egg into egg_cond_number
put 47 into target_egg
refreshegg
put step49_egg into egg_cond_number
put 49 into target_egg
refreshegg
put step50_egg into egg_cond_number
put 50 into target_egg
refreshegg
put step51_egg into egg_cond_number
put 51 into target_egg
refreshegg
unlock screen
End All_Refreshed

---------------Registration
On showstamp
show_lock
End showstamp


On inputkey
set_key
End inputkey

On go_registration
go cd 110
End go_registration




