Coder Social home page Coder Social logo

i-spy-game's Introduction

Some of my work โš™ ๐Ÿ‘จโ€๐Ÿ’ป ๐Ÿค“

  1. Ziaei Jam, H., Li, Y., DeVito, R., Mousavi, N., Ma, N., Lujumba, I., Adam, Y., Maksimov, M., Huang, B., Dolzhenko, E., Qiu, Y., Kakembo, F. E., Joseph, H., Onyido, B., Adeyemi, J., Bakhtiari, M., Park, J., Javadzadeh, S., Jjingo, D., Adebiyi, E., โ€ฆ Gymrek, M. (2023). A deep population reference panel of tandem repeat variation. Nature communications, 14(1), 6711. https://doi.org/10.1038/s41467-023-42278-3
  2. Ssekagiri, A., Jjingo, D., Lujumba, I., Bbosa, N., Bugembe, D. L., Kateete, D. P., Jordan, I. K., Kaleebu, P., & Ssemwanga, D. (2022). QuasiFlow: a Nextflow pipeline for analysis of NGS-based HIV-1 drug resistance data. Bioinformatics advances, 2(1), vbac089. https://doi.org/10.1093/bioadv/vbac089

Carpentries workshops I have participated in

  1. Software Carpentry Workshop, University of Twente, https://4turesearchdata-carpentries.github.io/2023-05-30-Twente/
  2. Data Carpentry Workshop, SADiLaR R Online, Rhodes University, https://bkmgit.github.io/2023-06-12-SADiLaR-R-Online/

i-spy-game's People

Contributors

harbi811 avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

alimanfoo

i-spy-game's Issues

Apply consistent code style

Two things could be done to create consistent code style:

  • Use the same style throughout for naming variables and functions, i.e., either underscores (foo_bar) or camel case (fooBar).
  • Format the source code with black.

Move the main game logic under the main function

Currently, the main game logic in the main module is at the module level.
Move this code under a function called main.

def main():
    # main game logic

This would be of benefit when running unit tests and if you want the game to be executed as a script on the terminal or imported in another module

Errors at different stages of the game after the user presses Enter or chooses some letters for the secret word

The game at this point relies on the user strictly following input rules for the category of words to play and also providing some form of input for each prompt. However, when the user does not provide input (ie, presses Enter at the prompt), different errors are returned at different stages of the game.

  1. Pressing Enter instead of providing the word category or providing the wrong category returns an Attribute Error.
  2. Pressing Enter as the user attempts to guess what the secret word chosen by the computer is returns an IndexError
  3. Some letters have one fruit that begins with that letter (e.g letters e and n). When the player chooses it as the first letter of their secret word, a ValueError is returned

Compare guesses case-insensitive

Currently the comparison between the player's guess and the secret word is case sensitive. The game messages do tell the player that they should type the word in lower case. But it would be nice to perform a case-insensitive comparison, so the player doesn't need to worry about this.

Computer guesses the same word twice

When the computer is trying to guess your word, it can sometimes try to guess the same word twice. This probably should be fixed, unless you want the computer to appear deliberately forgetful :)

Make it easier to guess the right word

Currently it's very hard for the player to guess the right word within seven guesses, because (unless you peek at the source code) you don't have any way to narrow down the set of possible words you should be thinking of.

Perhaps it would improve playability if there was a way that the player could ask for a clue. Perhaps this clue could be revealing another letter from the word.

Another approach could be to divide the game up into different categories, like "animals", for example. Before beginning a round, the player chooses which category to play. Then at least you know you should be trying to guess the name of an animal, not just any word beginning with the given letter.

You might want to split this into different issues, or rescope this depending on what your preferred approach is - just thought I would raise an issue to start discussion :)

Missing keys in some dictionaries

In some categories, such as "fruits", there are no English words I am aware of that begin with letters such as i, v and x. This raises a KeyError when the user specifies any of the letters as the first letter of the secret fruit.

Add word categories to the game

In reference to Issue #2, add word categories to the game to make it easier for the player to guess what word they should think of.
For example; fruit and animal categories. During each round of the game, the player should be able to decide what category to play from.

Offer clues to the player

In reference to Issue #2, offer clues to the player to make the game easier. If the player makes a wrong guess, the next letter of the word should be given as a clue. Repeat if the second guess is wrong and if the third guess is wrong, reveal the last letter of the word.

simplify the function where the computer guesses the player's secret word

The userPlay() function is too complex to understand what is going on.
You can simplify the function by breaking it down into smaller functions that achieve one task i.e.

  1. get the starting letter of the word from the player
  2. the computer attempts to guess the word
  3. the player provides his/her word
  4. a main function to control the above the functions

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.