--------------------card 42 -----------------
On opencard 42
  put 42 into presentcard
  if game_on is not 1 then
  play x99
   put 2 into ntx
   naratoranimex
  wait 1 seconds

  play bokuwo
   put 3 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 LocH of btn t_writer - 86, LocV of btn t_writer - 41, 9, "Haz clic cuando selecciones una flecha o una columna en el tablero!"
    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  x_value * y_value into x99ans
    QuizDlg4 "Qu nmero esperas?", 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 ----------

