Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- public class Program {
- static void Main() {
- string goblinName = "Goblin";
- int goblinHitPoints = 16;
- int goblinDamage = 2;
- int goblinExperienceReward = 15;
- string conanName = "Conan";
- int conanHitPoints = 16;
- int conanDamage = 6;
- int conanExperience = 0;
- bool keepFighting = true;
- while(keepFighting) {
- goblinHitPoints -= conanDamage;
- Console.WriteLine(conanName + " hits the " + goblinName + " for " + conanDamage + " damage");
- if(goblinHitPoints<1){
- Console.WriteLine(conanName + " has killed " + goblinName);
- Console.WriteLine(conanName + " has gained " + goblinExperienceReward + "xp.");
- conanExperience += goblinExperienceReward;
- break;
- }
- conanHitPoints -= goblinDamage;
- Console.WriteLine(goblinName + " hits the " + conanName + " for " + goblinDamage + " damage");
- if(conanHitPoints<1){
- Console.WriteLine(goblinName + " has killed " + conanName);
- break;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement