Skip to content

Instantly share code, notes, and snippets.

@alvinneocom
Created October 23, 2019 20:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alvinneocom/c76f8b8bc5d2c6d7589c831eefbc6bd2 to your computer and use it in GitHub Desktop.
Save alvinneocom/c76f8b8bc5d2c6d7589c831eefbc6bd2 to your computer and use it in GitHub Desktop.
yes
void hangman(int wrong)
{
for(int rowcounter = 0; rowcounter <= 3; rowcounter++)
{
if(rowcounter == 0)
{
printf("----\n");
}
if(rowcounter == 1)
{
printf("| ");
if(wrong > 0)
{
printf("o");
}
printf("\n");
}
if(rowcounter == 2)
{
printf("| ");
if(wrong == 2)
{
printf(" |");
}
if(wrong == 3)
{
printf("/|");
}
if(wrong > 3)
{
printf("/|\\");
}
printf("\n");
}
if(rowcounter == 3)
{
printf("| ");
if(wrong == 5)
{
printf("/");
}
if(wrong == 6)
{
printf("/ \\");
}
printf("\n");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment