بيت الحصريات
نرجوا التسجيل معنا لمعاينة المحتوي بشكل افضل

انضم إلى المنتدى ، فالأمر سريع وسهل

بيت الحصريات
نرجوا التسجيل معنا لمعاينة المحتوي بشكل افضل
بيت الحصريات
هل تريد التفاعل مع هذه المساهمة؟ كل ما عليك هو إنشاء حساب جديد ببضع خطوات أو تسجيل الدخول للمتابعة.

عمل صفحة انترنت واضافة لعبـة x - o لموقعك

اذهب الى الأسفل

 عمل صفحة انترنت واضافة لعبـة x - o لموقعك  Empty عمل صفحة انترنت واضافة لعبـة x - o لموقعك

مُساهمة من طرف Abdu Lutfy الإثنين نوفمبر 13, 2017 1:04 pm

اليوم ويآئ كود مميز وترفيهـي ! :15:
كان آنجليزي وانا مارضيت بهالشيء ! :20:
والحمد لله عربت الكود لعيـون آلديف بوينت ! :15:
كود لعبه آكس آو ! :24:

الكـود باللغه الانجليزيه قبل التعريب :


الكود:
 <SCRIPT LANGUAGE="LiveScript">
    <!---Copyright 1996 Chris Englmeier
    <!---Feel free to use this script as long as these copyright
    <!-- line remain as is
    <!--
    step = 0;
    diff=3;
    // change board when button is clicked
    function clear_all(form) {
      step = 0;
      for (i=0;i<9; ++i) {
        position="a"+i;
        form[position].value="";
      }
    }
    // change board when button is clicked
    function clickit(field) {
      if (step == -1) {********************("Reset to play again"); return;}
      position=field.name.substring(1,2,1);
      position = 'a'+position;
      if (field.form[position].value !="")
         {********************("Can't go there"); return;}
      field.form[position].value="X";
      if (eval_pos(field.form)) {
        field.form.output.value="You Win!";
        step = -1;
        return;
      }
      position=get_move(field.form);
      field.form.output.value='I moved to ' +
                              position.substring(1,2,1);
      if (position=="") {
        field.form.output.value="No Winner.";
        step = -1;
        return;
      }
      field.form[position].value="O";
      if (eval_pos(field.form)) {
        field.form.output.value="You Lose!";
        step = -1;
      }
    }
    // see if there is a winner
    function eval_pos(form) {
      if ((form.a0.value!="" && form.a0.value==form.a3.value &&
          form.a0.value==form.a6.value)||
          (form.a0.value!="" && form.a0.value==form.a1.value &&
          form.a0.value==form.a2.value) ||
          (form.a0.value!="" && form.a0.value==form.a4.value &&
          form.a0.value==form.a8.value) ||
          (form.a1.value!="" && form.a1.value==form.a4.value &&
          form.a1.value==form.a7.value) ||
          (form.a2.value!="" && form.a2.value==form.a5.value &&
          form.a2.value==form.a8.value) ||
          (form.a2.value!="" && form.a2.value==form.a4.value &&
          form.a2.value==form.a6.value) ||
          (form.a3.value!="" && form.a3.value==form.a4.value &&
          form.a3.value==form.a5.value) ||
          (form.a6.value!="" && form.a6.value==form.a7.value &&
          form.a6.value==form.a8.value))
          return true;
      else
          return false;
    }
    function f(a) {
      if (a == "") return "."; else return a;
    }
    // get position for move.
    function comp_move(form,player,weight,depth) {
      var cost;
      var bestcost=-2;
      var position;
      var newplayer;
      if (player=="X") newplayer="O"; else newplayer="X";
      if (depth==diff) return 0;
      if (eval_pos(form)) return 1;
      for (var i=0; i<9; ++i) {
        position='a'+i;
        if (form[position].value != "")
          continue;
        form[position].value=player;
        cost = comp_move(form,newplayer, -weight, depth+1);
        if (cost > bestcost) {
          bestcost=cost;
          if (cost==1) i=9;
        }
        form[position].value="";
      }
      if (bestcost==-2) bestcost=0;
      return(-bestcost);
    }
    // get position for move.
    function get_move(form) {
      var cost;
      var bestcost=-2;
      bestmove="";
      // don't think about first move.
      if (step++ == 0)
        if (form.a4.value=="") return "a4";
        else if (form.a0.value=="") return "a0";
        for (var i=0; i<9; ++i) {
          localposition='a'+i;
          if (form[localposition].value != "")
          continue;
        form[localposition].value="O";
        cost=comp_move(form,"X", -1, 0);
        if (cost > bestcost) {
          if (cost==1) i=9;
          bestmove=localposition;
          bestcost=cost;
        }
        form[localposition].value="";
      }
      return bestmove;
    }
    // complain if user attempts to change board
    function complain(field) {
      field.form.output.focus(); // put focus eleswhere
      ********************("Don't change the game fields directly!");
    }
    //a href="http://www.ucsd.edu/
    // the end -->
  </SCRIPT>
<FORM>
    <INPUT SIZE=1 NAME="a0" OnFocus="complain(this)">
    <INPUT TYPE="button" NAME="b0" OnClick="clickit(this)">
    <INPUT SIZE=1 NAME="a1" OnFocus="complain(this)">
    <INPUT TYPE="button" NAME="b1" OnClick="clickit(this)">
    <INPUT SIZE=1 NAME="a2" OnFocus="complain(this)">
    <INPUT TYPE="button" NAME="b2" OnClick="clickit(this)"><BR>
    <INPUT SIZE=1 NAME="a3" OnFocus="complain(this)">
    <INPUT TYPE="button" NAME="b3" OnClick="clickit(this)">
    <INPUT SIZE=1 NAME="a4" OnFocus="complain(this)">
    <INPUT TYPE="button" NAME="b4" OnClick="clickit(this)">
    <INPUT SIZE=1 NAME="a5" OnFocus="complain(this)">
    <INPUT TYPE="button" NAME="b5" OnClick="clickit(this)"><BR>
    <INPUT SIZE=1 NAME="a6" OnFocus="complain(this)">
    <INPUT TYPE="button" NAME="b6" OnClick="clickit(this)">
    <INPUT SIZE=1 NAME="a7" OnFocus="complain(this)">
    <INPUT TYPE="button" NAME="b7" OnClick="clickit(this)">
    <INPUT SIZE=1 NAME="a8" OnFocus="complain(this)">
    <INPUT TYPE="button" NAME="b8" OnClick="clickit(this)"><BR>
    <table border=0><tr><td>
      Message:</td><td> <INPUT NAME="output" TYPE="text"></td></tr>
      <tr><td>Difficulty: </td><td><SELECT NAME="difficulty"
      OnChange="diff=form.difficulty[form.difficulty.selectedIndex].value;">
      <OPTION VALUE=1> Very Easy
      <OPTION VALUE=2> Easy
      <OPTION VALUE=3 SELECTED> Medium
      <OPTION VALUE=4> Hard (may think a long time)
      </SELECT></td></tr>
      <tr><td></td><td><INPUT TYPE="button" VALUE="Computer Moves First"
      OnClick="if (!step++) this.form.a4.value='O';"></td></tr>
      <tr><td></td>
      <td><INPUT TYPE="reset" VALUE="Restart"
            OnClick="clear_all(this.form)"></td></tr>
    </table>
  </FORM>

الكود باللغة العربية :


الكود:
<SCRIPT LANGUAGE="LiveScript">
    <!---[COLOR="RoyalBlue"]Copyright 2010 By DeaD SouL - [ندعوك للتسجيل في المنتدى أو التعريف بنفسك لمعاينة هذا الرابط]
    <!---[COLOR="RoyalBlue"]copyright This code courtesy to all visitors Dev-PoinT/vb[/COLOR]
    <!-- [COLOR="RoyalBlue"]DeaD SouL ![/COLOR]
    <!--
    step = 0;
    diff=3;
    // change board when button is clicked
    function clear_all(form) {
      step = 0;
      for (i=0;i<9; ++i) {
        position="a"+i;
        form[position].value="";
      }
    }
    // change board when button is clicked
    function clickit(field) {
      if (step == -1) {********************("Reset to play again"); return;}
      position=field.name.substring(1,2,1);
      position = 'a'+position;
      if (field.form[position].value !="")
         {********************("Can't go there"); return;}
      field.form[position].value="X";
      if (eval_pos(field.form)) {
        field.form.output.value="You Win!";
        step = -1;
        return;
      }
      position=get_move(field.form);
      field.form.output.value='I moved to ' +
                              position.substring(1,2,1);
      if (position=="") {
        field.form.output.value="No Winner.";
        step = -1;
        return;
      }
      field.form[position].value="O";
      if (eval_pos(field.form)) {
        field.form.output.value="You Lose!";
        step = -1;
      }
    }
    // see if there is a winner
    function eval_pos(form) {
      if ((form.a0.value!="" && form.a0.value==form.a3.value &&
          form.a0.value==form.a6.value)||
          (form.a0.value!="" && form.a0.value==form.a1.value &&
          form.a0.value==form.a2.value) ||
          (form.a0.value!="" && form.a0.value==form.a4.value &&
          form.a0.value==form.a8.value) ||
          (form.a1.value!="" && form.a1.value==form.a4.value &&
          form.a1.value==form.a7.value) ||
          (form.a2.value!="" && form.a2.value==form.a5.value &&
          form.a2.value==form.a8.value) ||
          (form.a2.value!="" && form.a2.value==form.a4.value &&
          form.a2.value==form.a6.value) ||
          (form.a3.value!="" && form.a3.value==form.a4.value &&
          form.a3.value==form.a5.value) ||
          (form.a6.value!="" && form.a6.value==form.a7.value &&
          form.a6.value==form.a8.value))
          return true;
      else
          return false;
    }
    function f(a) {
      if (a == "") return "."; else return a;
    }
    // get position for move.
    function comp_move(form,player,weight,depth) {
      var cost;
      var bestcost=-2;
      var position;
      var newplayer;
      if (player=="X") newplayer="O"; else newplayer="X";
      if (depth==diff) return 0;
      if (eval_pos(form)) return 1;
      for (var i=0; i<9; ++i) {
        position='a'+i;
        if (form[position].value != "")
          continue;
        form[position].value=player;
        cost = comp_move(form,newplayer, -weight, depth+1);
        if (cost > bestcost) {
          bestcost=cost;
          if (cost==1) i=9;
        }
        form[position].value="";
      }
      if (bestcost==-2) bestcost=0;
      return(-bestcost);
    }
    // get position for move.
    function get_move(form) {
      var cost;
      var bestcost=-2;
      bestmove="";
      // don't think about first move.
      if (step++ == 0)
        if (form.a4.value=="") return "a4";
        else if (form.a0.value=="") return "a0";
        for (var i=0; i<9; ++i) {
          localposition='a'+i;
          if (form[localposition].value != "")
          continue;
        form[localposition].value="O";
        cost=comp_move(form,"X", -1, 0);
        if (cost > bestcost) {
          if (cost==1) i=9;
          bestmove=localposition;
          bestcost=cost;
        }
        form[localposition].value="";
      }
      return bestmove;
    }
    // complain if user attempts to change board
    function complain(field) {
      field.form.output.focus(); // put focus eleswhere
      ********************("Don't change the game fields directly!");
    }
    //a href="[COLOR="RoyalBlue"]www.Dev-PoinT.com/vb[/COLOR]
    // the end -->
  </SCRIPT>
<FORM>
    <INPUT SIZE=1 NAME="a0" OnFocus="complain(this)">
    <INPUT TYPE="button" NAME="b0" OnClick="clickit(this)">
    <INPUT SIZE=1 NAME="a1" OnFocus="complain(this)">
    <INPUT TYPE="button" NAME="b1" OnClick="clickit(this)">
    <INPUT SIZE=1 NAME="a2" OnFocus="complain(this)">
    <INPUT TYPE="button" NAME="b2" OnClick="clickit(this)"><BR>
    <INPUT SIZE=1 NAME="a3" OnFocus="complain(this)">
    <INPUT TYPE="button" NAME="b3" OnClick="clickit(this)">
    <INPUT SIZE=1 NAME="a4" OnFocus="complain(this)">
    <INPUT TYPE="button" NAME="b4" OnClick="clickit(this)">
    <INPUT SIZE=1 NAME="a5" OnFocus="complain(this)">
    <INPUT TYPE="button" NAME="b5" OnClick="clickit(this)"><BR>
    <INPUT SIZE=1 NAME="a6" OnFocus="complain(this)">
    <INPUT TYPE="button" NAME="b6" OnClick="clickit(this)">
    <INPUT SIZE=1 NAME="a7" OnFocus="complain(this)">
    <INPUT TYPE="button" NAME="b7" OnClick="clickit(this)">
    <INPUT SIZE=1 NAME="a8" OnFocus="complain(this)">
    <INPUT TYPE="button" NAME="b8" OnClick="clickit(this)"><BR>
    <table border=0><tr><td>
      الرسالـه:</td><td> <INPUT NAME="output" TYPE="text"></td></tr>
      <tr><td>المـستوى: </td><td><SELECT NAME="difficulty"
      OnChange="diff=form.difficulty[form.difficulty.selectedIndex].value;">
      <OPTION VALUE=1> سهل جداً
      <OPTION VALUE=2> سهل
      <OPTION VALUE=3 SELECTED> متوسط
      <OPTION VALUE=4> صعب (DeaD SouL ! - DeV-PoinT/vb)
      </SELECT></td></tr>
      <tr><td></td><td><INPUT TYPE="button" VALUE="لعب الكمبيوتر اولاً"
      OnClick="if (!step++) this.form.a4.value='O';"></td></tr>
      <tr><td></td>
      <td><INPUT TYPE="reset" VALUE="تجديد اللعبه"
            OnClick="clear_all(this.form)"></td></tr>
    </table>
  </FORM>


وقم بحفظ الصفحه من ملف > حفظ بأسم :24:
ومن ثم قم بتغير الامتداد من txt الي > html
والان قـم بالذهاب لمكان حفظ صفحتك وقم بفتحها ! :15:
الان نشوف اللعبه قبل & بعد التعريب ! :13
قبل تعريب الكود ! :27
بعد تعريب آلكود ! :27:
وبالهنآء والشفآء ! :15:
آن شاء الرحمن اني وفقت بالطرح والمهمه ! :28:

بالتوفيـق ! :32:
Abdu Lutfy
Abdu Lutfy
Admin

المساهمات : 98
تاريخ التسجيل : 11/11/2017
العمر : 32
الموقع : www.hasryaat.yoo7.com

https://hasryaat.yoo7.com

الرجوع الى أعلى الصفحة اذهب الى الأسفل

الرجوع الى أعلى الصفحة


 
صلاحيات هذا المنتدى:
لاتستطيع الرد على المواضيع في هذا المنتدى