Advertisement
Guest User

Trubbles

a guest
Jan 29th, 2015
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.45 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace Array
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.  
  13.  
  14.             int [] monsterList = new int[] {1,2,3,4,5};
  15.             int[] monsterHp = new int[] { 5, 6, 7, 8, 9 };
  16.             string[] monsterNames = new string[] { "Imp", "Goblin", "Skeleton", "Zombie", "Orc" };
  17.  
  18.             while (true)
  19.             {
  20.  
  21.                 Random spawn = new Random();
  22.                 int spawned = spawn.Next(0, 5);
  23.                
  24.                 if (spawned == 0)
  25.                 {
  26.                     Console.WriteLine("An " + monsterNames[spawned] + " appeard!");
  27.                     Console.WriteLine("Monster Health: " + monsterHp[spawned]);
  28.                     Console.ReadLine();
  29.                    
  30.                 }
  31.  
  32.                 if (spawned == 5)
  33.                 {
  34.                     Console.WriteLine("An " + monsterNames[spawned] + " appeard!");
  35.                     Console.WriteLine("Monster Health: " + monsterHp[spawned]);
  36.                     Console.ReadLine();
  37.                    
  38.                 }
  39.  
  40.                 else
  41.                 {
  42.                     Console.WriteLine("A " + monsterNames[spawned] + " appeard!");
  43.                     Console.WriteLine("Monster Health: " + monsterHp[spawned]);
  44.                     Console.ReadLine();
  45.                 }
  46.             }
  47.  
  48.  
  49.  
  50.         }
  51.     }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement