• 0
  • مالي خلق
  • أتهاوش
  • متضايق
  • مريض
  • مستانس
  • مستغرب
  • مشتط
  • أسولف
  • مغرم
  • معصب
  • منحرج
  • آكل
  • ابكي
  • ارقص
  • اصلي
  • استهبل
  • اضحك
  • اضحك  2
  • تعجبني
  • بضبطلك
  • رايق
  • زعلان
  • عبقري
  • نايم
  • طبيعي
  • كشخة
  • النتائج 1 إلى 3 من 3

    الموضوع: سؤال في الجافا ان شاء الله يتم تنفيذه

    1. #1
      التسجيل
      02-04-2004
      المشاركات
      1
      المواضيع
      1
      شكر / اعجاب مشاركة

      سؤال في الجافا ان شاء الله يتم تنفيذه




      بسم الله الرحمن الرحيم
      السلام عليكم ورحمة الله وبركاته


      اخوتي ....اردت عمل هذا البرنامج-اللعبة-ولكن نقص خبرتي ومعرفتي بلغة الجافا حالت دون قيامي بالبرنامج

      توضيح عمل اللعبة




      Write a Java program to play a game called Mastermind. In this game, the computer selects a three-digit number in which all three digits are distinct. The task of the player is to keep making guesses until she/he guesses all three digits in the proper order. Each time the player makes a guess, the computer tells the player:

      -How many hits the player had (one hit means getting one digit in its correct position), and

      -How many matches the player had (one match means getting one correct digit in the wrong position)

      example,,, if the computer's number was 586 and the player guessed 856, the computer would respond with



      1 hit

      2 matches



      After the player guesses the correct sequence of digits, the program should display the total number of guesses made, and then give the player the option to play again.



      Your program should be developed by using the following methods:

      1-generateCode: This function uses the random number generator to generate three distinct digits in the range 0 - 9, and stores them in the array for the computer's secret code.

      2-getGuess: This function reads in the player's guess as a String, converts the three characters to integers, and stores them in the guess array. The function should check if the 3-didgit number contains 3 distinct digits, otherwise the user has to input the number again.

      3-compare: This function compares the computer's generated numbers with the player's guess, and calculates the number of hits and matches. Then it should return true if the user scored 3 hits.

      4-printResults: This function displays the number of hits and matches for a given guess.

      ولكم جزيل الشكر .....

    2. #2
      التسجيل
      09-03-2002
      الدولة
      صنعاء اليمن
      المشاركات
      55
      المواضيع
      11
      شكر / اعجاب مشاركة

      Re: سؤال في الجافا ان شاء الله يتم تنفيذه

      اخي العزيز اليك الحل لكن مع قليل من الفروق حيث
      استخدمت الـ string لخزن الرقم السري للبرنامج بدلا من المصفوفات ارجو
      ان يحوز على رضاك

      سلام
      الملفات المرفقة الملفات المرفقة

    3. #3
      التسجيل
      19-12-2003
      الدولة
      aun shmas
      المشاركات
      2
      المواضيع
      1
      شكر / اعجاب مشاركة

      Thumbs up Re: سؤال في الجافا ان شاء الله يتم تنفيذه

      الف شكر يا غالى يا حبوب



      وان شاء الله مع المذيد والمذيد والسلام عليكم ورحمة الله وبركاته
      الطبيب :vereymad:

    المواضيع المتشابهه

    1. عندك وقت إذآ تعال (إذا حملت الصفحة قفل النت وجهز الشاهي)
      بواسطة : حذيفة بن اليمان , في المنتدى العام
      مشاركات: 14
      آخر مشاركة: 07-09-2004, 11:10 PM
    2. الانتصار على العادة السرية
      بواسطة : moKatel , في المواضيع الإسلامية المميزة
      مشاركات: 64
      آخر مشاركة: 20-08-2004, 11:15 PM
    3. مشاركات: 2
      آخر مشاركة: 29-04-2004, 06:11 PM
    4. للباحثين عن الحقيقة (فـــــــــــــقــــــــــــط)
      بواسطة : حذيفة بن اليمان , في المنتدى العام
      مشاركات: 0
      آخر مشاركة: 21-03-2004, 01:16 AM
    5. صوره لبنت .. ولا كل البنات
      بواسطة : الجميلي , في المنتدى العام
      مشاركات: 26
      آخر مشاركة: 24-02-2004, 11:48 PM

    ضوابط المشاركة

    • لا تستطيع إضافة مواضيع جديدة
    • لا تستطيع الرد على المواضيع
    • لا تستطيع إرفاق ملفات
    • لا تستطيع تعديل مشاركاتك
    •