Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace CypherRoulette
- {
- class CypherRoulette
- {
- static void Main(string[] args)
- {
- int number = int.Parse(Console.ReadLine());
- string specialCommand = "spin";
- string stringBox = "";
- int specialCheckerForReset = 0;
- string wordCheckerForReset = "";
- int lamp = 0;
- for (int i = 1; i <= number; i++)
- {
- string randomString = Console.ReadLine();
- if (wordCheckerForReset==randomString)
- {
- stringBox = "";
- wordCheckerForReset = "";
- continue;
- }
- wordCheckerForReset = randomString;
- if (randomString==specialCommand)
- {
- if (lamp==1)
- {
- lamp = 0;
- }
- else
- {
- lamp = 1;
- }
- i--;
- specialCheckerForReset++;
- if (specialCheckerForReset == 2)
- {
- stringBox = "";
- specialCheckerForReset = 0;
- lamp = 0;
- }
- wordCheckerForReset = "";
- continue;
- }
- else
- {
- specialCheckerForReset = 0;
- }
- if (lamp==0)
- {
- stringBox += randomString;
- }
- else
- {
- stringBox = randomString + stringBox;
- }
- }
- Console.WriteLine(stringBox);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement