ANA SAYFA | FORUM | BLOG | SİTENİZ İÇİN | İÇERİK EKLE | EN YENİLER | EN POPÜLERLER | EN BEĞENİLENLER | REKLAM | İLETİŞİM
Arama:
Tüm kategorilerde Google Forumda JAVAScript Araçlar
// ÖZELLEŞTİR
E-posta:
Şifre:
Üye Ol
|
Şifremi Unuttum
>> ARŞİVİMİZ FORUM AÇILDI! (0 yorum)>> Ramazan Bayramınız kutlu olsun (2 yorum)>> Kurban Bayramı (0 yorum)>> 10 Kasım (1 yorum)>> CUMHURİYET BAYRAMI (0 yorum)
// EN YENİLER
// EN POPÜLER
// Anasayfa » JAVASCRIPT» Oyunlar ve Eğlence
Oy:
>> Arşivimiz Forum'da Toggler the Sidebar Mini-Game (ing) ile ilgili açılmış konuları ara>> Veya bu içerik ile ilgili yeni bir konu aç
<!-- Flooble.com toggler start --> <script language="javascript"> var max = 3; var score = 0; var moves = 0; function press(form, button) { name = button.name; x = name.substring(0,1); y = name.substring(2,3); play(form, (x-1+1), (y-1+1)); } function play(form, x, y) { moves++; toggle(form, x, y); toggle(form, x-1, y); toggle(form, x+1, y); toggle(form, x, y-1); toggle(form, x, y+1); if (score == 16) { if (moves == 4) { w = ''That\''s the best possible score!''; } else { w = ''See if you can do any better!''; } alert(''You win after '' + moves + '' moves! \n'' + w); resetboard(form); } } function showrules() { rules = ''Toggler - from flooble.com \n\n'' + ''The goal of the game is to turn \n'' + ''all the buttons from [X] to [.]. \n'' + ''This is done by clicking buttons. \n'' + ''When a button is clicked, its state is \n'' + ''toggeled, but so is the state of four \n'' + ''buttons around it, so plan carefully! \n''; alert(rules); } function resetboard(form) { var i,j,button; for (i = 0; i < 4; i++) { for (j = 0; j < 4; j++) { button = getelement(form, i + ''_'' + j); button.value=''X''; } } score = 0; moves = 0; } function getelement(form, name) { var k; var elements = form.elements; for (k = 0; k < elements.length; k++) { if (elements[k].name == name) return elements[k]; } } function toggle(form, x, y) { if (x < 0 || y < 0 || x > max || y > max) { //alert(''Ignore ('' + x + '','' + y + '')''); return; } name = x + ''_'' + y; button = getelement(form, name); a = button.value; button.value = ''!!!''; //alert(a + '' ('' + x + '','' + y + '')'') ; button.value = a; if (button.value == ''X'') { button.value = ''.''; score ++; } else { button.value = ''X''; score --; } } </script> <table border="0" cellspacing="0" cellpadding="1"> <form> <tr> <td><input style="width:30px;" type="button" name="0_0" value="X" onclick="press(this.form, this);"></td> <td><input style="width:30px;" type="button" name="1_0" value="X" onclick="press(this.form, this);"></td> <td><input style="width:30px;" type="button" name="2_0" value="X" onclick="press(this.form, this);"></td> <td><input style="width:30px;" type="button" name="3_0" value="X" onclick="press(this.form, this);"></td> </tr> <tr> <td><input style="width:30px;" type="button" name="0_1" value="X" onclick="press(this.form, this);"></td> <td><input style="width:30px;" type="button" name="1_1" value="X" onclick="press(this.form, this);"></td> <td><input style="width:30px;" type="button" name="2_1" value="X" onclick="press(this.form, this);"></td> <td><input style="width:30px;" type="button" name="3_1" value="X" onclick="press(this.form, this);"></td> </tr> <tr> <td><input style="width:30px;" type="button" name="0_2" value="X" onclick="press(this.form, this);"></td> <td><input style="width:30px;" type="button" name="1_2" value="X" onclick="press(this.form, this);"></td> <td><input style="width:30px;" type="button" name="2_2" value="X" onclick="press(this.form, this);"></td> <td><input style="width:30px;" type="button" name="3_2" value="X" onclick="press(this.form, this);"></td> </tr> <tr> <td><input style="width:30px;" type="button" name="0_3" value="X" onclick="press(this.form, this);"></td> <td><input style="width:30px;" type="button" name="1_3" value="X" onclick="press(this.form, this);"></td> <td><input style="width:30px;" type="button" name="2_3" value="X" onclick="press(this.form, this);"></td> <td><input style="width:30px;" type="button" name="3_3" value="X" onclick="press(this.form, this);"></td> </tr> <tr> <td colspan="2"> <input style="width:62px;" type="button" value="reset" onclick="resetboard(this.form);"> </td> <td colspan="2"> <input style="width:62px;" type="button" value="rules" onclick="showrules();"> </td> </tr> <tr> <td colspan="4" style="font-family:Verdana; font-size:10px;"> <a href="http://www.flooble.com/scripts/toggler.php">get <b>toggler</b></a> @ <a href="http://www.flooble.com/">flooble</a> </td> </tr> </form> </table> <img src="http://www.flooble.com/images/dot.gif?src=toggler" width="1" height="1"> <noscript> <a href="http://www.blackjack-primer.com">Blackjack Tutorial</a> </noscript> <!-- Flooble.com toggler end -->
Kodu Kopyala
Hata Bildir | Tavsiye Et
Bu içeriğe oy verin:
Yorumlar / Yeni Yorum Yaz Bu içeriğe yorum yazılmamış.
ANA SAYFA | İÇERİK EKLE | YENİ EKLENENLER | EN POPÜLERLER | EN BEĞENİLENLER | REKLAM | DESTEKLEYENLER | İLETİŞİM
JAVAScript İndir © 2004 - 2008Web Tasarımı: Emir Emiroğlu | Kodlama: Can "FiNaRFiN" HANHAN , Korkut TAHAOĞLU, Göktuğ İÇÖZ