Giter Site home page Giter Site logo

hangman-in-c's Introduction

hangman-in-C

Hangman game in C

Tools Used:

  • Emacs
  • Oracle VM Virtual Box

This program must be run on a Linux system because it takes words from /usr/share/dict/words/.
I used an Ubuntu Oracle VM Virtual Box to create this project.

Hangman Art By Chris Horton

Functions

to_str_lower
is_guess_word
get_random_word
get_guess
print_underlines
put_guess_in_letters_guessed
is_guess_in_word
is_word_guessed
print_hangman

to_str_lower

Make all the char of str lowercase
void to_str_lower(char *string)

is_guess_word

Is the given string a word?
bool is_guess_word(char *string)

get_random_word

Get and returnd a random word from words file
char *get_random_word(void)

get_guess

Asks user for input and cleans it up and returns it
char *get_guess(void)

print_underlines

Print the letters in the user guessed correctly
void print_underlines(const char *word, const char letters_guessed[])

put_guess_in_letters_guessed

Puts all the guessed letters into an array
void put_guess_in_letters_guessed(char letters_guessed[], char *user_guess)

is_guess_in_word

Is the guess (letter/word) in the random_word?
bool is_guess_in_word(const char *word, char *letters_guessed, char *user_guess)

is_word_guessed

Is the word guessed?
bool is_word_guessed(const char *word, const char letters_guessed[], char *user_guess)

print_hangman

Prints lives in a visual hangman format
void print_hangman(const int lives)

hangman-in-c's People

Contributors

jaizon2000 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.