الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

(c++) مساعدة في برنامج hangman

مغلق
بدأه Mrs.Questions في 14 ديسمبر 2003 · 7 رد · 784 مشاهدة · في الأسئلة المجابة
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

Hi there .... also i need your help in the following program ..

its a game called ( HANGMAN ) witch the user will see stars on the screen (*****) and he have to imagine what this word is

the program must have 2 array of strings : one of them to save the original word )for example : i saved the word TEST) and the second string to save the stars and it must be the same number of letters in the saved word (in our example it must be four stars like this **** )and when the user enter any letter we have to check if this letter is exist we have to make a change in the second array by taking out the star and put the entered letter and if this letter is repeated more than one time we have to put it in the coorect places ..... and the user have only 10 times to try in this game , and if the entered letter is wrong he have to tell him ( ERROR) and if he guess the word correctly the program will say ( you win ) .otherwise ( you loose ) and thats all ......thanx for reading and i wish u can help me

Mrs. questions

تم تعديل هذه المشاركة بواسطة Mrs.Questions في 14 ديسمبر 2003 في 16:37

#2

برنامج فكرته رائعة والله ،،

و أتمنى أحله لك ،، بس لازم نشوف محاولتك ،،

و صدقني ،، لو حليتها لك ماراح تستفيد شئ ،،

بعكس لو إنت حليتها و شفنا محاولتك ،،

و سامحني على فلسفتي ،،

أختك ،،

#3

أختي العصامية ... أولا شكرا على ردك ( وبعدين أنا أختك مش أخوكي (",) .... )

أنا هذا البرنامج جاني في اختبار وحاولت أحله لكن المشكلة مرة مو راضي يظبط وأنا ممكن أكتب الكود اللي أنا كتبته وحأنزله بس هو غلط عشان كده كنت أبغا أعرف فكرة حله

#4

السلام عليكم,

لقد سبق وأدرجت مثالا لهدا في هدا المنتدى ويمكنكم مشاهدة هدا في الرابط التالي.والمرجو لمن يزيد أي تغيير في المثال أن يضعه هنا حتى تعم الفائدة.

http://www.arabteam2000.com/ib/index.php?s...topic=35853&hl=

لى اللقاء.

#5

أخوي chick ،،،

مشكور والله ،، و جوزيت خيراً ،، :)

و راح أحاول أبدا بحل هذا البرنامج ،، اللي بالفعل عاجبتني فكرتها ،،

و بعدها بأشوف اللي عالرابط ،،

لإنهم بنفس الفكرة على قولتك ،، و الإختلاف بسيط ،، :)

أختك ،،

و معليه أختي Mrs.Questions

قريتها بالغلط ،، :(

و تحية لك ،، :)

لي عودة بإذن المولى ،،

#6

أنا هذه الفكرة اللي بدأت أحل بيها بس مهي صح ومهو راضي يسوي run بس الفكرة اللي جات في بالي هيا هذه معليش تقولولي إذا كانت صح ولا غلط ؟؟!!!!

#include<iostream.h>
#include<conio.h>
#include<string.h>
#include<stdio.h>
void search(char arr[],int ch);
void main()
{
	char arr1[]="nada",arr2[15];
	int len,ch;
	len=strlen(arr1);
	for (int i=0;i<len;i++)
  arr2='*';
	for (int j=0;j<len;j++)
  cout<<arr2[j];
	for (int k=0;k<10;k++)
	{
  cout<<"enter a letter: ";
  cin>>ch;
  search(arr1,ch);
	}
	getch();
}
//*************************************
void search(char arr[],int ch)
{
	for (int i=0;i<len;i++)
	{
  if (arr1==ch)
  {
 	 arr2=ch;
 	 search(arr,ch);
  }
  else 
 	 cout<<"Error";
	}
	for (int j=0;j<len;j++)
	{
  if (arr2[j]!=arr1[j])
 	 cout<<"YOU LOOSE..";
  else
 	 cout<<"YOU WIN..";
	}
}
#7

شوف هذا .. اذا كان هو نفس اللي تتكلم عنه او لا ؟ .. انا هنا حفظت جواه 50 كلمة .. شغل البرنامج وشوف ..

HangMan__.zip

#8

Hi there ....

ايوا طلع هو هذا البرنامج يا cup holder .......... معليش تقولي فكرته أو معليش تعطيني الكود حقه عشان أنا والله مرة حست فيه ..... ومـــرة شكرا

هذا الموضوع مغلق.

مواضيع مشابهة