- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
function verify()
{
//1
if(event.clientX >= 20 && event.clientX <= 113 && event.clientY >= 20 && event.clientY <= 90 && trigger == 1)
{
name.style.top=21
name.style.left=21
name.border=0
if(name.name == "one"){counter1=1; document.all.ok.style.visibility = 'visible'; document.all.no.style.visibility = 'hidden'}
else{counter1=0; document.all.no.style.visibility = 'visible'; document.all.ok.style.visibility = 'hidden'; errors++}
trigger = 0
movements++
document.all.movements.value = movements
}
//2
if(event.clientX >= 113 && event.clientX <= 206 && event.clientY >= 20 && event.clientY <= 90 && trigger == 1)
{
name.style.top=21
name.style.left=114
name.border=0
if(name.name == "two"){counter2=1; document.all.ok.style.visibility = 'visible'; document.all.no.style.visibility = 'hidden'; errors++}else{counter2=0; document.all.no.style.visibility = 'visible'; document.all.ok.style.visibility = 'hidden'; errors++}
trigger = 0
movements++
document.all.movements.value = movements
}
//3
if(event.clientX >= 206 && event.clientX <= 299 && event.clientY >= 20 && event.clientY <= 90 && trigger == 1)
{
name.style.top=21
name.style.left=207
name.border=0
if(name.name == "three"){counter3=1; document.all.ok.style.visibility = 'visible'; document.all.no.style.visibility = 'hidden'}else{counter3=0; document.all.no.style.visibility = 'visible'; document.all.ok.style.visibility = 'hidden'; errors++}
trigger = 0
movements++
document.all.movements.value = movements
}
//4
if(event.clientX >= 299 && event.clientX <= 392 && event.clientY >= 20 && event.clientY <= 90 && trigger == 1)
{
name.style.top=21
name.style.left=300
name.border=0
if(name.name == "four"){counter4=1; document.all.ok.style.visibility = 'visible'; document.all.no.style.visibility = 'hidden'}else{counter4=0; document.all.no.style.visibility = 'visible'; document.all.ok.style.visibility = 'hidden'; errors++}
trigger = 0
movements++
document.all.movements.value = movements
//И так - 30 раз:))
Говнокодил давно, еще в школе. Года через 4, в универе, вернулся к этому коду и ничего не смог понять:) Новое решение заняло примерно в 10 раз меньше места.