
On OpenCard
    Lock screen
    setting45
    hideomoriall
	Unlock Screen
	Put 0 Into hakariWeight1
	Put 0 Into hakariWeight2
	SetHakari1
	SetHakari2



If Game_on is not 1 then
  play kurabe
    put 3 into ntx
   naratoranimex
   wait 2 seconds
  play bokuwo
    put 5 into ntx
   naratoranimex
end if












End OpenCard








On hideomoriall
   repeat with i = 1 to 8
    put Item i of twokilogramomori into nn
    hide btn %nn%
   end repeat
   hide btn DmyWeigh
End hideomoriall


On setting45
 put  19 into Item 1 of twokilogramomori
 put  20 into Item 2 of twokilogramomori
 put  21 into Item 3 of twokilogramomori
 put  22 into Item 4 of twokilogramomori
 put  23 into Item 5 of twokilogramomori
 put  24 into Item 6 of twokilogramomori
 put  25 into Item 7 of twokilogramomori
 put  26 into Item 8 of twokilogramomori
end setting45



















On SetHakari1
	Put hakariWeight1 * 3.6 Into kaku
	Set Data of btn hari1 to kaku
End SetHakari1

On SetHakari2
	Put hakariWeight2 * 3.6 Into kaku
	Set Data of btn hari2 to kaku
End SetHakari2

On WeightUp1x
	Put hakariWeight1 + 1 Into hakariWeight1
	if hakariWeight1 > 99 then
		Put 0 Into hakariWeight1
	end if
	SetHakari1
End WeightUp1x

On WeightUp1
	WeightUp1x
	Wait 20 ticks
	Repeat While Mouse() is Down
		WeightUp1x
		Wait 10 ticks
	end Repeat
End WeightUp1

On WeightDown1x
	Put hakariWeight1 - 1 Into hakariWeight1
	if hakariWeight1 < 0 then
		Put 99 Into hakariWeight1
	end if
	SetHakari1
End WeightDown1x

On WeightDown1
	WeightDown1x
	Wait 20 ticks
	Repeat While Mouse() is Down
		WeightDown1x
		Wait 10 ticks
	end Repeat
End WeightDown1

On WeightUp2x
	Put hakariWeight2 + 1 Into hakariWeight2
	if hakariWeight2 > 99 then
		Put 0 Into hakariWeight2
	end if
	SetHakari2
End WeightUp2x

On WeightUp2
	WeightUp2x
	Wait 20 ticks
	Repeat While Mouse() is Down
		WeightUp2x
		Wait 10 ticks
	end Repeat
End WeightUp2

On WeightDown2x
	Put hakariWeight2 - 1 Into hakariWeight2
	if hakariWeight2 < 0 then
		Put 99 Into hakariWeight2
	end if
	SetHakari2
End WeightDown2x

On WeightDown2
	WeightDown2x
	Wait 20 ticks
	Repeat While Mouse() is Down
		WeightDown2x
		Wait 10 ticks
	end Repeat
End WeightDown2

--------------------------------
On Quiz45
put 0 into score45
Repeat 5 times
Set Data of btn hari1 to 0
Put 0 Into hakariWeight1
Set Data of btn hari2 to 0
Put 0 Into hakariWeight2
  put random( 8 ) into ww
   if ww = 1 then
       put 10 - random(4) into xx
   end if
   if ww = 2 then
       put 20 - random(4) into xx
   end if
   if ww = 3 then
       put 30 - random(4) into xx
   end if
   if ww = 4 then
       put 40 - random(4) into xx
   end if
   if ww = 5 then
       put 50 - random(4) into xx
   end if
   if ww = 6 then
       put 60 - random(4) into xx
   end if
   if ww = 7 then
       put 80 - random(4) into xx
   end if

   if ww = 8 then
       put 100 - random(4) into xx
   end if
---------------

  put random( 8 ) into zz
   if zz = 1 then
       put 10 - random(4) into xxx
   end if
   if zz = 2 then
       put 20 - random(4) into xxx
   end if
   if zz = 3 then
       put 30 - random(4) into xxx
   end if
   if zz = 4 then
       put 40 - random(4) into xxx
   end if
   if zz = 5 then
       put 50 - random(4) into xxx
   end if
   if zz = 6 then
       put 60 - random(4) into xxx
   end if
   if zz = 7 then
       put 80 - random(4) into xxx
   end if

   if zz = 8 then
       put 100 - random(4) into xxx
   end if





 lock screen
   put Item ww of twokilogramomori into bb
   repeat with i = 1 to 8
    put Item i of twokilogramomori into nn
    hide btn %nn%
   end repeat
   show btn %bb%
unlock screen
   
  Repeat with i= 1 to xx
   WeightUp1x
  end repeat


 lock screen
   Put zz -1 into GivenBtnNum
   DmyBitmapSet
  put Item zz of twokilogramomori into bbb
  set loc of btn DmyWeigh to 430, LocV of btn %bbb% 
  show btn DmyWeigh
unlock screen
   
  Repeat with i= 1 to xxx
   WeightUp2x
  end repeat










---------------
put xx * 20 into ans_45_1
put xxx * 20 into ans_45_2
if ans_45_1 > ans_45_2 then
    put ans_45_1 - ans_45_2 into ans_45
QuizDlg12 "La diferencia entre los dos pesos es ___Kg___g", ans_45
  else
     put ans_45_2 - ans_45_1 into ans_45

QuizDlg12 "La diferencia entre los dos pesos es ___Kg___g", ans_45
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

             exit repeat

           else
              play jawharp
              showwitch_surprised
           end if
   else
           play good
           show_frog_good
           put score45 + 1 into score45
 end if

-----------
End repeat
if score45 =5 then
   ok100
end if
if score45 =4 then
   ok80
end if
if score45 =3 then
   ok60
end if
             lock screen
             hideomoriall
             Set Data of btn hari1 to 0
             Put 0 Into hakariWeight1
             Set Data of btn hari2 to 0
             Put 0 Into hakariWeight2
             unlock screen

End Quiz45



On DmyBitmapSet
if GivenBtnNum = 0 then 
     set bitmap of btn DmyWeigh to Weight6
end if
if GivenBtnNum = 1 then 
     set bitmap of btn DmyWeigh to Weight1
end if
if GivenBtnNum = 2 then 
     set bitmap of btn DmyWeigh to Weight7
end if
if GivenBtnNum = 3 then 
     set bitmap of btn DmyWeigh to Weight2
end if
if GivenBtnNum = 4 then 
     set bitmap of btn DmyWeigh to Weight8
end if
if GivenBtnNum = 5 then 
     set bitmap of btn DmyWeigh to Weight3
end if
if GivenBtnNum = 6 then 
     set bitmap of btn DmyWeigh to Weight4
end if
if GivenBtnNum = 7 then 
     set bitmap of btn DmyWeigh to Weight5
end if
End DmyBitmapSet


--------------------------------
On Quiz45_2
put 0 into score45
Repeat 2 times
Set Data of btn hari1 to 0
Put 0 Into hakariWeight1
Set Data of btn hari2 to 0
Put 0 Into hakariWeight2
  put random( 8 ) into ww
   if ww = 1 then
       put 10 - random(4) into xx
   end if
   if ww = 2 then
       put 20 - random(4) into xx
   end if
   if ww = 3 then
       put 30 - random(4) into xx
   end if
   if ww = 4 then
       put 40 - random(4) into xx
   end if
   if ww = 5 then
       put 50 - random(4) into xx
   end if
   if ww = 6 then
       put 60 - random(4) into xx
   end if
   if ww = 7 then
       put 80 - random(4) into xx
   end if

   if ww = 8 then
       put 100 - random(4) into xx
   end if
---------------

  put random( 8 ) into zz
   if zz = 1 then
       put 10 - random(4) into xxx
   end if
   if zz = 2 then
       put 20 - random(4) into xxx
   end if
   if zz = 3 then
       put 30 - random(4) into xxx
   end if
   if zz = 4 then
       put 40 - random(4) into xxx
   end if
   if zz = 5 then
       put 50 - random(4) into xxx
   end if
   if zz = 6 then
       put 60 - random(4) into xxx
   end if
   if zz = 7 then
       put 80 - random(4) into xxx
   end if

   if zz = 8 then
       put 100 - random(4) into xxx
   end if





 lock screen
   put Item ww of twokilogramomori into bb
   repeat with i = 1 to 8
    put Item i of twokilogramomori into nn
    hide btn %nn%
   end repeat
   show btn %bb%
unlock screen
   
  Repeat with i= 1 to xx
   WeightUp1x
  end repeat


 lock screen
   Put zz -1 into GivenBtnNum
   DmyBitmapSet
  put Item zz of twokilogramomori into bbb
  set loc of btn DmyWeigh to 430, LocV of btn %bbb% 
  show btn DmyWeigh
unlock screen
   
  Repeat with i= 1 to xxx
   WeightUp2x
  end repeat










---------------
put xx * 20 into ans_45_1
put xxx * 20 into ans_45_2
if ans_45_1 > ans_45_2 then
    put ans_45_1 - ans_45_2 into ans_45
QuizDlg12 "La diferencia entre los dos pesos es ___Kg___g", ans_45
  else
     put ans_45_2 - ans_45_1 into ans_45

QuizDlg12 "La diferencia entre los dos pesos es ___Kg___g", ans_45
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

             exit repeat

           else
              play jawharp
              showwitch_surprised

              exit repeat
           end if
   else
           play good
           show_frog_good
           put score45 + 1 into score45
 end if

-----------
End repeat
if score45 =5 then
   ok100
end if
if score45 =4 then
   ok80
end if
if score45 =3 then
   ok60
end if
             lock screen
             hideomoriall
             Set Data of btn hari1 to 0
             Put 0 Into hakariWeight1
             Set Data of btn hari2 to 0
             Put 0 Into hakariWeight2
             unlock screen

End Quiz45_2



