De.coder
473 subscribers
458 photos
44 videos
191 files
300 links
Download Telegram
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
10. بازی jack black

زبان نوشتاری #C

سطح برنامه متوسط

@de_coder
De.coder();

بازی دوز
زبان نوشتاری #C
سطح برنامه متوسط


این برنامه توسط تی ای استاد شاهپریان به عنوان تمرین اختیاری درس ساختمان داده به دانشجویان دانشکده فنی تهران جنوب داده شده است .
@de_coder
پیاده سازی MultiThreading با یک مثال

زبان : #C

سطح : آسان

@de_coder
پیاده سازی MultiThreading

زبان #C

سطح برنامه آسان

@de_coder
بازی دوز با استفاده از داده ساختار Linked List

زبان : #C

سطح برنامه : متوسط

Developed by : S3PEHR

@de_coder
برنامه پذیرش و ترخیص بیمارستان

زبان #C

Developed by : Pilo

@de_coder
×××× این برنامه به درخواست کاربران قرار داده شده است××××

ساخت Dictionary

زبان #C

با استفاده از داده ساختار Trie Tree

Developed by : JR.Y

@de_coder
TrieDictionary.rar
50.4 KB
سورس کد برنامه Dictionary با استفاده از داده ساختار Trie Tree به زبان #C
Developed by : JR.Y

@de_coder
پیاده سازی الگوریتم هافمن با استفاده از Hash Table

زبان #C

Developed by MHMV

@de_coder