Skip to content

Instantly share code, notes, and snippets.

@DaNooba
Created June 3, 2018 19:17
Show Gist options
  • Save DaNooba/b5505a5fb4773e25b1f6828a9376cae6 to your computer and use it in GitHub Desktop.
Save DaNooba/b5505a5fb4773e25b1f6828a9376cae6 to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Space_iNator
{
class Program
{
static void Main(string[] args)
{
while (true)
{
Console.WriteLine("Insert text to space out here:");
string input = Console.ReadLine();
var i = 1;
foreach (char c in input)
{
input = input.Insert(i, " ");
i = i + 2;
}
Console.WriteLine(input);
while (true)
{
var exit = 0;
Console.WriteLine("Continue? y/n");
string cont = Console.ReadLine();
switch (cont)
{
case "y":
exit = 1;
break;
case "n":
Environment.Exit(0);
break;
default:
Console.WriteLine("Please enter a valid command.");
break;
}
if(exit == 1)
{
break;
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment