# budilnik
<<<<<<< 316_budilnik
if $ARGS[0] = 'start':
=======
if $ARGS[0]='start':
>>>>>>> 316_budilnik
cla
clr
<<<<<<< 316_budilnik
gs 'stat'
'<center><img src="images\etogame\bed2.jpg"></center>'
=======
gs'stat'
'<center><img src="pic/bed2.jpg" ></center>'
>>>>>>> 316_budilnik
*nl
*nl
<<<<<<< 316_budilnik
if numbud = 4: '<center><B><<bud1>><<bud2>>: <<bud3>><<bud4>></B></center>'
if numbud = 3: '<center><B><<bud1>><<bud2>>: <<bud3>></B><<bud4>></center>'
if numbud = 2: '<center><B><<bud1>><<bud2>></B>: <<bud3>><<bud4>></center>'
if numbud = 1: '<center><B><<bud1>></B><<bud2>>: <<bud3>><<bud4>></center>'
if numbud = 0: '<center><<bud1>><<bud2>> <<bud3>><<bud4>></center>'
*nl
'<center><B><a href="exec:GT ''budilnik'',''1''">1</a> <a href="exec:GT ''budilnik'',''2''">2</a> <a href="exec:GT ''budilnik'',''3''">3</a></B></center>'
'<center><B><a href="exec:GT ''budilnik'',''4''">4</a> <a href="exec:GT ''budilnik'',''5''">5</a> <a href="exec:GT ''budilnik'',''6''">6</a></B></center>'
'<center><B><a href="exec:GT ''budilnik'',''7''">7</a> <a href="exec:GT ''budilnik'',''8''">8</a> <a href="exec:GT ''budilnik'',''9''">9</a></B></center>'
'<center><B><a href="exec:GT ''budilnik'',''0''">0</a></B></center>'
'<center><B><a href="exec:GT ''budilnik'',''Reset''">Reset</a> <a href="exec:GT ''budilnik'',''Time''">Set the time</a></B></center>'
	act 'Put Service':
	cla
	set bud1 = 0
	set bud2 = 0
	set bud3 = 0
	set bud4 = 0
	set numbud = 0
	gt 'budilnik','fin'
	end
=======
if numbud = 4:'<center><B><<bud1>><<bud2>> : <<bud3>><<bud4>></B></center>'
if numbud = 3:'<center><B><<bud1>><<bud2>> : <<bud3>></B><<bud4>></center>'
if numbud = 2:'<center><B><<bud1>><<bud2>></B> : <<bud3>><<bud4>></center>'
if numbud = 1:'<center><B><<bud1>></B><<bud2>> : <<bud3>><<bud4>></center>'
if numbud = 0:'<center><<bud1>><<bud2>> : <<bud3>><<bud4>></center>'
*nl
'<center><B><a href="exec:GT ''budilnik'',''1''">1</a>   <a href="exec:GT ''budilnik'',''2''">2</a>   <a href="exec:GT ''budilnik'',''3''">3</a></B></center>'
'<center><B><a href="exec:GT ''budilnik'',''4''">4</a>   <a href="exec:GT ''budilnik'',''5''">5</a>   <a href="exec:GT ''budilnik'',''6''">6</a></B></center>'
'<center><B><a href="exec:GT ''budilnik'',''7''">7</a>   <a href="exec:GT ''budilnik'',''8''">8</a>   <a href="exec:GT ''budilnik'',''9''">9</a></B></center>'
'<center><B><a href="exec:GT ''budilnik'',''0''">0</a></B></center>'
'<center><B><a href="exec:GT ''budilnik'',''reset''">reset</a>    <a href="exec:GT ''budilnik'',''time''">Set time</a></B></center>'
     act 'put Service':
     cla
     set bud1 = 0
     set bud2 = 0
     set bud3 = 0
     set bud4 = 0
     set numbud = 0
     gt'budilnik','fin'
     end
>>>>>>> 316_budilnik
end

<<<<<<< 316_budilnik
if $ARGS[0] = 'Time':
=======
if $ARGS[0]='time':
>>>>>>> 316_budilnik
cla
if bud1 > 0:
<<<<<<< 316_budilnik
set timer = bud1 * 10
set timer += bud2
=======
set timer = bud1*10
set timer = timer + bud2
>>>>>>> 316_budilnik
end
if bud2 > 0 and bud1 = 0:
set timer = bud2
end
<<<<<<< 316_budilnik
if bud1 = 0 and bud2 = 0:
set timer = 0
end
if bud3 > 0:
set timerM = bud3 * 10
set timerM += bud4
=======
if bud3 > 0:
set timerM = bud3*10
set timerM = timerM + bud4
>>>>>>> 316_budilnik
end
if bud4 > 0 and bud3 = 0:
set timerM = bud4
end
<<<<<<< 316_budilnik
if bud3 = 0 and bud4 = 0:
set timerM = 0
end
if timer > 23: set timer = 0
if timerM > 60: set timerM = 0

'Clock wound <<timer>> hours <<timerM>> minutes.'

	act 'Service put in place':
	cla
	gt 'budilnik','fin'
	end
=======
if timer > 23:set timer = 0
if timerM > 60:set timerM = 0

'Service on the wound <<timer>> hours, <<timerM>> minutes.'

     act 'Service put in place':
     cla
     gt'budilnik','fin'
     end
>>>>>>> 316_budilnik
end


<<<<<<< 316_budilnik
if $ARGS[0] = '1':
cla
	if numbud = 4:
	end
	if numbud = 3: set bud4 = 1 & set numbud = 4
	if numbud = 2: set bud3 = 1 & set numbud = 3
	if numbud = 1: set bud2 = 1 & set numbud = 2
	if numbud = 0: set bud1 = 1 & set numbud = 1
gt 'budilnik','start'
=======
if $ARGS[0]='1':
cla
     if numbud = 4:
     end
     if numbud = 3:set bud4 = 1&set numbud = 4
     if numbud = 2:set bud3 = 1&set numbud = 3
     if numbud = 1:set bud2 = 1&set numbud = 2
     if numbud = 0:set bud1 = 1&set numbud = 1
gt'budilnik','start'
>>>>>>> 316_budilnik
end

<<<<<<< 316_budilnik
if $ARGS[0] = '2':
cla
	if numbud = 4:
	end
	if numbud = 3: set bud4 = 2 & set numbud = 4
	if numbud = 2: set bud3 = 2 & set numbud = 3
	if numbud = 1: set bud2 = 2 & set numbud = 2
	if numbud = 0: set bud1 = 2 & set numbud = 1
gt 'budilnik','start'
=======
if $ARGS[0]='2':
cla
     if numbud = 4:
     end
     if numbud = 3:set bud4 = 2&set numbud = 4
     if numbud = 2:set bud3 = 2&set numbud = 3
     if numbud = 1:set bud2 = 2&set numbud = 2
     if numbud = 0:set bud1 = 2&set numbud = 1
gt'budilnik','start'
>>>>>>> 316_budilnik
end

<<<<<<< 316_budilnik
if $ARGS[0] = '3':
cla
	if numbud = 4:
	end
	if numbud = 3: set bud4 = 3 & set numbud = 4
	if numbud = 2: set bud3 = 3 & set numbud = 3
	if numbud = 1: set bud2 = 3 & set numbud = 2
	if numbud = 0: set bud1 = 3 & set numbud = 1
gt 'budilnik','start'
=======
if $ARGS[0]='3':
cla
     if numbud = 4:
     end
     if numbud = 3:set bud4 = 3&set numbud = 4
     if numbud = 2:set bud3 = 3&set numbud = 3
     if numbud = 1:set bud2 = 3&set numbud = 2
     if numbud = 0:set bud1 = 3&set numbud = 1
gt'budilnik','start'
>>>>>>> 316_budilnik
end

<<<<<<< 316_budilnik
if $ARGS[0] = '4':
cla
	if numbud = 4:
	end
	if numbud = 3: set bud4 = 4 & set numbud = 4
	if numbud = 2: set bud3 = 4 & set numbud = 3
	if numbud = 1: set bud2 = 4 & set numbud = 2
	if numbud = 0: set bud1 = 4 & set numbud = 1
gt 'budilnik','start'
=======
if $ARGS[0]='4':
cla
     if numbud = 4:
     end
     if numbud = 3:set bud4 = 4&set numbud = 4
     if numbud = 2:set bud3 = 4&set numbud = 3
     if numbud = 1:set bud2 = 4&set numbud = 2
     if numbud = 0:set bud1 = 4&set numbud = 1
gt'budilnik','start'
>>>>>>> 316_budilnik
end

<<<<<<< 316_budilnik
if $ARGS[0] = '5':
cla
	if numbud = 4:
	end
	if numbud = 3: set bud4 = 5 & set numbud = 4
	if numbud = 2: set bud3 = 5 & set numbud = 3
	if numbud = 1: set bud2 = 5 & set numbud = 2
	if numbud = 0: set bud1 = 5 & set numbud = 1
gt 'budilnik','start'
=======
if $ARGS[0]='5':
cla
     if numbud = 4:
     end
     if numbud = 3:set bud4 = 5&set numbud = 4
     if numbud = 2:set bud3 = 5&set numbud = 3
     if numbud = 1:set bud2 = 5&set numbud = 2
     if numbud = 0:set bud1 = 5&set numbud = 1
gt'budilnik','start'
>>>>>>> 316_budilnik
end

<<<<<<< 316_budilnik
if $ARGS[0] = '6':
cla
	if numbud = 4:
	end
	if numbud = 3: set bud4 = 6 & set numbud = 4
	if numbud = 2: set bud3 = 6 & set numbud = 3
	if numbud = 1: set bud2 = 6 & set numbud = 2
	if numbud = 0: set bud1 = 6 & set numbud = 1
gt 'budilnik','start'
=======
if $ARGS[0]='6':
cla
     if numbud = 4:
     end
     if numbud = 3:set bud4 = 6&set numbud = 4
     if numbud = 2:set bud3 = 6&set numbud = 3
     if numbud = 1:set bud2 = 6&set numbud = 2
     if numbud = 0:set bud1 = 6&set numbud = 1
gt'budilnik','start'
>>>>>>> 316_budilnik
end

<<<<<<< 316_budilnik
if $ARGS[0] = '7':
cla
	if numbud = 4:
	end
	if numbud = 3: set bud4 = 7 & set numbud = 4
	if numbud = 2: set bud3 = 7 & set numbud = 3
	if numbud = 1: set bud2 = 7 & set numbud = 2
	if numbud = 0: set bud1 = 7 & set numbud = 1
gt 'budilnik','start'
=======
if $ARGS[0]='7':
cla
     if numbud = 4:
     end
     if numbud = 3:set bud4 = 7&set numbud = 4
     if numbud = 2:set bud3 = 7&set numbud = 3
     if numbud = 1:set bud2 = 7&set numbud = 2
     if numbud = 0:set bud1 = 7&set numbud = 1
gt'budilnik','start'
>>>>>>> 316_budilnik
end

<<<<<<< 316_budilnik
if $ARGS[0] = '8':
cla
	if numbud = 4:
	end
	if numbud = 3: set bud4 = 8 & set numbud = 4
	if numbud = 2: set bud3 = 8 & set numbud = 3
	if numbud = 1: set bud2 = 8 & set numbud = 2
	if numbud = 0: set bud1 = 8 & set numbud = 1
gt 'budilnik','start'
=======
if $ARGS[0]='8':
cla
     if numbud = 4:
     end
     if numbud = 3:set bud4 = 8&set numbud = 4
     if numbud = 2:set bud3 = 8&set numbud = 3
     if numbud = 1:set bud2 = 8&set numbud = 2
     if numbud = 0:set bud1 = 8&set numbud = 1
gt'budilnik','start'
>>>>>>> 316_budilnik
end

<<<<<<< 316_budilnik
if $ARGS[0] = '9':
cla
	if numbud = 4:
	end
	if numbud = 3: set bud4 = 9 & set numbud = 4
	if numbud = 2: set bud3 = 9 & set numbud = 3
	if numbud = 1: set bud2 = 9 & set numbud = 2
	if numbud = 0: set bud1 = 9 & set numbud = 1
gt 'budilnik','start'
=======
if $ARGS[0]='9':
cla
     if numbud = 4:
     end
     if numbud = 3:set bud4 = 9&set numbud = 4
     if numbud = 2:set bud3 = 9&set numbud = 3
     if numbud = 1:set bud2 = 9&set numbud = 2
     if numbud = 0:set bud1 = 9&set numbud = 1
gt'budilnik','start'
>>>>>>> 316_budilnik
end

<<<<<<< 316_budilnik
if $ARGS[0] = '0':
cla
	if numbud = 4:
	end
	if numbud = 3: set bud4 = 0 & set numbud = 4
	if numbud = 2: set bud3 = 0 & set numbud = 3
	if numbud = 1: set bud2 = 0 & set numbud = 2
	if numbud = 0: set bud1 = 0 & set numbud = 1
gt 'budilnik','start'
=======
if $ARGS[0]='0':
cla
     if numbud = 4:
     end
     if numbud = 3:set bud4 = 0&set numbud = 4
     if numbud = 2:set bud3 = 0&set numbud = 3
     if numbud = 1:set bud2 = 0&set numbud = 2
     if numbud = 0:set bud1 = 0&set numbud = 1
gt'budilnik','start'
>>>>>>> 316_budilnik
end

<<<<<<< 316_budilnik
if $ARGS[0] = 'Reset':
=======
if $ARGS[0]='reset':
>>>>>>> 316_budilnik
cla
set bud1 = 0
set bud2 = 0
set bud3 = 0
set bud4 = 0
set numbud = 0
<<<<<<< 316_budilnik
gt 'budilnik','start'
=======
gt'budilnik','start'
>>>>>>> 316_budilnik
end


<<<<<<< 316_budilnik
if $ARGS[0] = 'fin':
=======
if $ARGS[0]='fin':
>>>>>>> 316_budilnik
cla
gt $locM, $metkaM
<<<<<<< 316_budilnik
	!'if housr = 1 and housrA = 1:
	set housrA = 0
	gt 'bedr'
	end'
=======
     !'if housr = 1 and housrA = 1:
     set housrA = 0
     gt'bedr'
     end'
>>>>>>> 316_budilnik
end
--- budilnik ---------------------------------

