منتدى رواية عشق

منتدى رواية عشق (https://r-eshq.com/vb/index.php)
-   ϟ تَطويـر المُنتديـات ϟ (https://r-eshq.com/vb/forumdisplay.php?f=52)
-   -   كود لعبة الارقام داخل منتداك (https://r-eshq.com/vb/showthread.php?t=80879)

شيخة رواية 05-18-2020 12:16 PM

كود لعبة الارقام داخل منتداك
 
ضع هذا الكود حيث تريد ظهور اللعبة






كود:
كود PHP:

  <s c r i p t language="j a v a   s c r i p t">

/*****************************************
* Translated By www.absba.com/
* Visit our site at http://www.absba.org/ for more code
* This notice must stay intact for use
***********************************************/

        
var max 3;
        var 
score 0;
        var 
moves 0;
        var 
ex 3;
        var 
ey 3;
        
        function 
getElement15(formname) {
            var 
k;
            var 
elements form.elements;
            for (
0elements.lengthk++) {
                if (
elements[k].name == name) return elements[k];
            }
        }
        
        function 
press15(formbutton) {
            
name button.name;
            
name.substring(0,1);
            
name.substring(2,3);
            
play15(form, (x-1+1), (y-1+1));
        }
        
        function 
shuffle15(formnum) {
            for (
0numi++) {
                
Math.floor(Math.random(4) * 4);
                if (
== 0) { toggle15(formexeyex 1ey); }
                else if (
== 1) { toggle15(formexeyex 1ey); }
                else if (
== 2) { toggle15(formexeyexey 1); }
                else if (
== 3) { toggle15(formexeyexey 1); }
            }
        }
        
        function 
play15(formxy) {            
            if (
Math.abs(ex x) + Math.abs(ey y) == 1) {
                
done toggle15(formxyx+1y);
                if (!
done) { done toggle15(formxyx-1y); }
                if (!
done) { done toggle15(formxyxy+1); }
                if (!
done) { done toggle15(formxyxy-1);    }
                
moves++;
                if (
check15(form)) {
                    
alert('You win with ' moves ' moves!');
                    
resetboard15(form);
                }
            }
            
        }

        function 
showrules15() {
            
rules 'لعبة لوح الأرقام \n\n' 
                
'هدف اللعبة هو ترتيب \n' 
                
'الأرقام من 1 الى 15 بنفس \n'
                
'الترتيب اللي ظاهر عندك ببداية اللعبة\n'
                
'اضغط على خلط وابدأ اللعب\n'
                
'وتفوز اذا رتبت كل الأرقام\n'
                
'والمربع اللي يبقى فاضي بالأخير \n'
                
'هو اللي بأسفل الزاوية اليمنى';
            
alert(rules);
        }
        
        function 
resetboard15(form) {
            for (
04i++) {
                for (
04j++) {
                    
val + (4*j);
                    if (
val == 16) {
                        
getElement15(form,'_' j).value ' ';
                    } else {
                        
getElement15(form,'_' j).value val;
                    }
                }
            }
            
score 0;
            
moves 0;
            
ex 3;
            
ey 3;
        }
    
        function 
toggle15(formxyx1y1) {
            if (
|| || max || max) {
                return 
false;
            }
            if (
x1 || y1 || x1 max || y1 max) {
                return 
false;
            }

            
name '_' y;
            
button getElement15(form,name);
            
name x1 '_' y1;
            
button1 getElement15(form,name);
            if (
button.value == ' ' || button1.value == ' ') {
                
tmp button.value;
                
button.value button1.value;
                
button1.value tmp;
                if (
button.value == ' ') {
                    
ex x;
                    
ey y;
                } else {
                    
ex x1;
                    
ey y1;
                }
                return 
true;
            }
            return 
false;
        }
        
        function 
check15(form) {
            
score 0;
            for (
04i++) {
                for (
04j++) {
                    
val + (4*j);
                    if (
val 16) {
                        if (
getElement15(form,'_' j).value == val) {
                            
score++;
                        }
                    }
                }
            }
            return 
score == 15;
        }
    
</script>
    
    <table border="0" cellspacing="0" cellpadding="1">
        <form>
        <tr>
            <td><input style="width:30px;" type="button" name="0_0" value="1" onclick="press15(this.form, this);"></td>
            <td><input style="width:30px;" type="button" name="1_0" value="2" onclick="press15(this.form, this);"></td>
            <td><input style="width:30px;" type="button" name="2_0" value="3" onclick="press15(this.form, this);"></td>
            <td><input style="width:30px;" type="button" name="3_0" value="4" onclick="press15(this.form, this);"></td>
        </tr>
        <tr>
            <td><input style="width:30px;" type="button" name="0_1" value="5" onclick="press15(this.form, this);"></td>
            <td><input style="width:30px;" type="button" name="1_1" value="6" onclick="press15(this.form, this);"></td>
            <td><input style="width:30px;" type="button" name="2_1" value="7" onclick="press15(this.form, this);"></td>
            <td><input style="width:30px;" type="button" name="3_1" value="8" onclick="press15(this.form, this);"></td>
        </tr>
        <tr>
            <td><input style="width:30px;" type="button" name="0_2" value="9" onclick="press15(this.form, this);"></td>
            <td><input style="width:30px;" type="button" name="1_2" value="10" onclick="press15(this.form, this);"></td>
            <td><input style="width:30px;" type="button" name="2_2" value="11" onclick="press15(this.form, this);"></td>
            <td><input style="width:30px;" type="button" name="3_2" value="12" onclick="press15(this.form, this);"></td>
        </tr>
        <tr>
            <td><input style="width:30px;" type="button" name="0_3" value="13" onclick="press15(this.form, this);"></td>
            <td><input style="width:30px;" type="button" name="1_3" value="14" onclick="press15(this.form, this);"></td>
            <td><input style="width:30px;" type="button" name="2_3" value="15" onclick="press15(this.form, this);"></td>
            <td><input style="width:30px;" type="button" name="3_3" value=" " onclick="press15(this.form, this);"></td>
        </tr>
        <tr>
            <td colspan="2">
                <input style="width:62px;" type="button" value="إعادة تعيين" onclick="resetboard15(this.form);">
            </td>
            <td colspan="2">
                <input style="width:62px;" type="button" value="الشروط" onclick="showrules15();">
            </td>
        </tr>
        <tr>
            <td colspan="4">
                <input style="width:126px;" type="button" value="خلط" onclick="shuffle15(this.form,150);">
            </td>
        </tr>
                </form>
        </table> 


احذف الفراغات بين كلمة "j a v a s c r i p t"

ريماس 05-18-2020 04:56 PM

-

كل لشكر لك ل جمال م نثر
موودتي مع كل التقدير

:241:

الأمير 05-18-2020 05:03 PM


سَلَّمَتْ أناملكِم الذَّهَبِيَّةَ عَلَى الطَّرْحِ الرَّائِعِ الَّذِي
أَنَارَ صَفْحَاتِ مُنْتَدَى روآية عِشْقٌ بِكُلِّ مَاهُوِ جَديدٍ
لُكِمَ مَنِّيُّ أَرَقٍ وَأَجْمَلِ التَّحَايَا عَلَى هَذَا التَّأَلُّقِ وَالْأبْدَاعِ
وَالَّذِي هُوَ حليفكِم دُومَا " أَنَّ شَاءَ اللهُ
https://akhawat.islamway.net/forum/u...1199813295.gif

شيخة رواية 05-18-2020 05:04 PM

كل الشكر لكم على تواجدكم الجميل وردكم الرائع
دمتم بالف خير ..

رُّوحي بروحهُ 05-18-2020 09:09 PM

يعطيك العافيه يارب , ع الموضوع
دمت ودام ابداعك ف سما عشق ...


..

شيخة رواية 05-18-2020 10:33 PM

كل الشكر لكم على تواجدكم الجميل وردكم الرائع
دمتم بالف خير ..


الساعة الآن 12:48 AM

Powered by vBulletin Hosting By R-ESHQ
HêĽм √ 3.1 BY: ! RESHQ ! © 2010
new notificatio by R-ESHQ
User Alert System provided by Advanced User Tagging (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
تنويه : المشاركات المطروحة تعبر عن وجهة نظر أصحابها وليس بالضرورة تمثل رأي أدارة الموقع