Skip to content

Instantly share code, notes, and snippets.

@Dyrits
Last active May 10, 2023 08:08
Show Gist options
  • Save Dyrits/dd9033e1ca1239c76cb58e09ad4af747 to your computer and use it in GitHub Desktop.
Save Dyrits/dd9033e1ca1239c76cb58e09ad4af747 to your computer and use it in GitHub Desktop.
Exquisite Corpse

Exquisite Corpse

In the game Exquisite Corpse, participants draw either a head, body, or feet of a creature. The players don’t know how their part of the body connects to the other two, until the drawing is finished and revealed.

For this project, you’ll write a program that mimics the Exquisite Corpse game. Using methods, you’ll be able to randomly combine different parts of ASCII characters so they create a new creature.

using System;
namespace ExquisiteCorpse
{
class Program
{
static void Main(string[] args)
{
BuildACreature("ghost", "monster", "bug");
RandomMode();
}
static void BuildACreature(string head, string body, string feet)
{
switch(head.ToLower())
{
case "ghost":
GhostHead();
break;
case "monster":
MonsterHead();
break;
case "bug":
BugHead();
break;
}
switch(body.ToLower())
{
case "ghost":
GhostBody();
break;
case "monster":
MonsterBody();
break;
case "bug":
BugBody();
break;
}
switch(feet.ToLower())
{
case "ghost":
GhostFeet();
break;
case "monster":
MonsterFeet();
break;
case "bug":
BugFeet();
break;
}
}
static void RandomMode()
{
Random random = new Random();
int head = random.Next(1, 4);
int body = random.Next(1, 4);
int feet = random.Next(1, 4);
SwitchCase(head, body, feet);
}
static string TranslateToString(int value) {
string result = "ghost";
switch(value) {
case 1:
result = "ghost";
break;
case 2:
result = "monster";
break;
case 3:
result = "bug";
break;
}
return result;
}
static void SwitchCase(int head, int body, int feet) {
string creatureHead = TranslateToString(head);
string creatureBody = TranslateToString(body);
string creatureFeet = TranslateToString(feet);
BuildACreature(creatureHead, creatureBody, creatureFeet);
}
static void GhostHead()
{
Console.WriteLine(" ..-..");
Console.WriteLine(" ( o o )");
Console.WriteLine(" | O |");
}
static void GhostBody()
{
Console.WriteLine(" | |");
Console.WriteLine(" | |");
Console.WriteLine(" | |");
}
static void GhostFeet()
{
Console.WriteLine(" | |");
Console.WriteLine(" | |");
Console.WriteLine(" '~~~~~'");
}
static void BugHead()
{
Console.WriteLine(" / \\");
Console.WriteLine(" \\. ./");
Console.WriteLine(" (o + o)");
}
static void BugBody()
{
Console.WriteLine(" --| | |--");
Console.WriteLine(" --| | |--");
Console.WriteLine(" --| | |--");
}
static void BugFeet()
{
Console.WriteLine(" v v");
Console.WriteLine(" *****");
}
static void MonsterHead()
{
Console.WriteLine(" _____");
Console.WriteLine(" .-,;='';_),-.");
Console.WriteLine(" \\_\\(),()/_/");
Console.WriteLine("  (,___,)");
}
static void MonsterBody()
{
Console.WriteLine(" ,-/`~`\\-,___");
Console.WriteLine(" / /).:.('--._)");
Console.WriteLine(" {_[ (_,_)");
}
static void MonsterFeet()
{
Console.WriteLine(" | Y |");
Console.WriteLine(" / | \\");
Console.WriteLine(" \"\"\"\" \"\"\"\"");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment