Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Security.Cryptography;
- namespace Examrpep
- {
- class Program
- {
- static void Main(string[] args)
- {
- List<string> chest = Console.ReadLine() //define chest state
- .Split("|")
- .ToList();
- List<string> cmd = new List<string>(); //declare command
- while (cmd[0] != "Yohoho!") //read commands until "Yohoho!"
- {
- cmd = Console.ReadLine() //define the command
- .Split(" ")
- .ToList();
- if (cmd[0] == "Loot")
- {
- for (int i = 1; i <= cmd.Count(); i++)
- {
- if (chest.Contains(cmd[i]) == false) chest.Insert(0, cmd[i]);
- //if the chest doesn't already have the loot, insert it at index 0
- }
- }
- else if(cmd[0] == "Drop")
- {
- int.Parse(cmd[1]); //convert 2nd element of cmd[] to a number
- if (cmd[1] < 0 || cmd[1] > chest.Count()) continue; //checks if given index isn't valid
- }
- else if (cmd[0] == "Steal")
- {
- }
- }
- if(chest.Count() > 0)
- {
- }
- else
- {
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement