7. ساخت یک نبرد اتوماتیک
زبان نوشتاری #C
سطح برنامه : متوسط رو به بالا
*********//*********
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace de_coder
{
class Program
{
static void Main(string[] args)
{
int herohealth;
int monsterhealth;
string monstername;
int monsterhealthbegining;
Random healthgen = new Random();
herohealth = healthgen.Next(5, 21);
Console.WriteLine("you have " + herohealth + " health");
monsterhealth = healthgen.Next(5, 21);
monsterhealthbegining = monsterhealth;
if (monsterhealth <= 8)
{
monstername = "goblin";
Console.WriteLine("A simple goblin with " + monsterhealth + " health attacks!");
goto heroattack;
}
else if (monsterhealth >= 9 && 13 >= monsterhealth )
{
monstername = "owlbear";
Console.WriteLine("An owlbear with " + monsterhealth + " health attacks!");
goto heroattack;
}
else if (monsterhealth >= 14 && 17 >= monsterhealth)
{
monstername = "orc";
Console.WriteLine("An orc with " + monsterhealth + " health attacks!");
goto heroattack;
}
else
{
monstername = "dragon";
Console.WriteLine("A dragon with " + monsterhealth + " health attacks!");
goto heroattack;
}
heroattack:
System.Threading.Thread.Sleep(50);
if (herohealth >= 0)
{
Random roll = new Random();
int roll20;
int roll6;
int damage;
roll20 = roll.Next(1, 21);
if (roll20 >= 9)
{
Console.Write("You hit it for ");
roll6 = roll.Next(1, 7);
Console.WriteLine(roll6 + " damage!");
damage = roll6;
monsterhealth -= damage;
if (monsterhealth >= 0)
{
goto monsterattack;
}
else
{
Console.WriteLine("You win!");
}
}
else
{
Console.WriteLine("You missed!");
goto monsterattack;
}
}
else
{
Console.WriteLine("You loose!");
}
monsterattack:
System.Threading.Thread.Sleep(50);
if (monsterhealth >= 0)
{
Random roll = new Random();
int roll202;
int roll62;
int damage2;
roll202 = roll.Next(1, 21);
if (roll202 >= 9)
{
Console.Write("It hits you for ");
roll62 = roll.Next(1, 7);
Console.WriteLine(roll62 + " damage!");
damage2 = roll62;
herohealth -= damage2;
if (herohealth >= 0)
{
goto heroattack;
}
else
{
Console.WriteLine("You loose!");
}
}
else
{
Console.WriteLine("It missed!");
goto heroattack;
}
}
else
{
int reward;
reward = monsterhealthbegining * 10;
Console.WriteLine("You got " + reward + " silver for slaying the " + monstername + ".");
}
}
}
}
@de_coder
زبان نوشتاری #C
سطح برنامه : متوسط رو به بالا
*********//*********
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace de_coder
{
class Program
{
static void Main(string[] args)
{
int herohealth;
int monsterhealth;
string monstername;
int monsterhealthbegining;
Random healthgen = new Random();
herohealth = healthgen.Next(5, 21);
Console.WriteLine("you have " + herohealth + " health");
monsterhealth = healthgen.Next(5, 21);
monsterhealthbegining = monsterhealth;
if (monsterhealth <= 8)
{
monstername = "goblin";
Console.WriteLine("A simple goblin with " + monsterhealth + " health attacks!");
goto heroattack;
}
else if (monsterhealth >= 9 && 13 >= monsterhealth )
{
monstername = "owlbear";
Console.WriteLine("An owlbear with " + monsterhealth + " health attacks!");
goto heroattack;
}
else if (monsterhealth >= 14 && 17 >= monsterhealth)
{
monstername = "orc";
Console.WriteLine("An orc with " + monsterhealth + " health attacks!");
goto heroattack;
}
else
{
monstername = "dragon";
Console.WriteLine("A dragon with " + monsterhealth + " health attacks!");
goto heroattack;
}
heroattack:
System.Threading.Thread.Sleep(50);
if (herohealth >= 0)
{
Random roll = new Random();
int roll20;
int roll6;
int damage;
roll20 = roll.Next(1, 21);
if (roll20 >= 9)
{
Console.Write("You hit it for ");
roll6 = roll.Next(1, 7);
Console.WriteLine(roll6 + " damage!");
damage = roll6;
monsterhealth -= damage;
if (monsterhealth >= 0)
{
goto monsterattack;
}
else
{
Console.WriteLine("You win!");
}
}
else
{
Console.WriteLine("You missed!");
goto monsterattack;
}
}
else
{
Console.WriteLine("You loose!");
}
monsterattack:
System.Threading.Thread.Sleep(50);
if (monsterhealth >= 0)
{
Random roll = new Random();
int roll202;
int roll62;
int damage2;
roll202 = roll.Next(1, 21);
if (roll202 >= 9)
{
Console.Write("It hits you for ");
roll62 = roll.Next(1, 7);
Console.WriteLine(roll62 + " damage!");
damage2 = roll62;
herohealth -= damage2;
if (herohealth >= 0)
{
goto heroattack;
}
else
{
Console.WriteLine("You loose!");
}
}
else
{
Console.WriteLine("It missed!");
goto heroattack;
}
}
else
{
int reward;
reward = monsterhealthbegining * 10;
Console.WriteLine("You got " + reward + " silver for slaying the " + monstername + ".");
}
}
}
}
@de_coder
Forwarded from Deleted Account
کانالی درباره برنامه نویسی از هر زبانی ک فکرش را بکنید.
آموزش تمام زبان های برنامه نویسی دنیا
وبه همراه نمونه کار و خروجی برنامه.
ویژه رشته کامپیوتر.🆕
⬇️⬇️⬇️⬇️⬇️⬇️⬇️
DE.coder();
https://telegram.me/de_coder
آموزش تمام زبان های برنامه نویسی دنیا
وبه همراه نمونه کار و خروجی برنامه.
ویژه رشته کامپیوتر.🆕
⬇️⬇️⬇️⬇️⬇️⬇️⬇️
DE.coder();
https://telegram.me/de_coder
یکی از مواردی که یک برنامه نویس باید به آن توجه داشته باشد ، سایت هایی است که در آن می تواند سوالات مربوط به برنامه نویسی خود را از دیگران بپرسد و پاسخ آن را دریافت کند
در بین این سایت ها معروف ترین آن سایت زیر است
https://stackoverflow.com
ما قصد داریم یک سایت دیگری را نیز به شما معرفی بکنیم که کمتر کسی آن را می شناسد
و آن سایت زیر می باشد
https://medium.com
یکی از ویژگی های این سایت این است که تمامی نکات را با آموزش کامل و به طور تصویری در اختیار شما قرار می دهد ، خودتان امتحان کنید
برای دسترسی بهتر به این لینک دانلود این اپلیکیشن را هم برایتان قرار می دهیم
android :
https://play.google.com/store/apps/details?id=com.medium.reader&hl=en&referrer=utm_source%3Dgoogle%26utm_medium%3Dorganic%26utm_term%3Dmedium+app&pcampaignid=APPU_1_EU8jWNzsJoewsQGrk4TwDg
ios :
https://itunes.apple.com/app/medium-everyones-stories/id828256236?pt=698524&mt=8
@de_coder
در بین این سایت ها معروف ترین آن سایت زیر است
https://stackoverflow.com
ما قصد داریم یک سایت دیگری را نیز به شما معرفی بکنیم که کمتر کسی آن را می شناسد
و آن سایت زیر می باشد
https://medium.com
یکی از ویژگی های این سایت این است که تمامی نکات را با آموزش کامل و به طور تصویری در اختیار شما قرار می دهد ، خودتان امتحان کنید
برای دسترسی بهتر به این لینک دانلود این اپلیکیشن را هم برایتان قرار می دهیم
android :
https://play.google.com/store/apps/details?id=com.medium.reader&hl=en&referrer=utm_source%3Dgoogle%26utm_medium%3Dorganic%26utm_term%3Dmedium+app&pcampaignid=APPU_1_EU8jWNzsJoewsQGrk4TwDg
ios :
https://itunes.apple.com/app/medium-everyones-stories/id828256236?pt=698524&mt=8
@de_coder
jazb-sari-traffic_[www.ketabesabz.com].pdf
375.8 KB
راز و رمز های جذب سریع ترافیک
برای افزایش آمار بازدید سایت
کاری از گروه آزادی مالی
#کتاب
#جذب_سریع_ترافیک
#سایت
@de_coder
برای افزایش آمار بازدید سایت
کاری از گروه آزادی مالی
#کتاب
#جذب_سریع_ترافیک
#سایت
@de_coder