Giter Club home page Giter Club logo

sorting-hat's Introduction

Harry Potter Hat Sorter Quiz

A Quiz asking users a series of Harry Potter themed questions to determine which house they belong to in the Harry Potter universe.

Usage


In Terminal

Open Terminal to file location and enter:

$ ruby sorting_hat.rb

Screenshots

Starting Screen: Intro Screen

Question Example: Questions

Possible End Result: End Result

Planning


Our General Idea

Create a Harry Potter Sorting Hat Quiz with a bunch of Harry Potter questions with some ideas from the Fallout 3 G.O.A.T (Generalized Occupational Aptitude Test), and we also added an Aussie twist to a few of the answers.

Workflow Board

Trello

Installation

Users will also need to download the colorize ruby gem by running this code in terminal:

$ gem install colorize

Limitations

1.

With our code, the answers will have to be the same order, meaning if the user was to choose answer option 1, it will always give Gryffindor a point, so we can't put the Slytherin answer for answer option 1 because it'll give Gryffindor a point and NOT SLYTHERIN.

Image

    if answer == 1
       gryffindor_points += 1
   elsif answer == 2
       slytherin_points += 1
   elsif answer == 3
       hufflepuff_points += 1
   elsif answer == 4
       ravenclaw_points += 1

We can maybe bypass this limitation by maybe using an array to store data, and use .push method to add in certain values (1 - 4) into our array and then count which appears more often to determine the winning house.

2.

With our point scoring system, if the user scores an equal amount of points for 2 of the house points, it'll choose whichever house is first in our if statement.

Polishing up our code

We decided to split the code into 3 files, to make it easier to read. We have the main file, questions file and the ascii text file.

For the questions we made them into methods, and called upon them in our while loop.

We made the big ASCII text into class constants. We could've achieved this by making them into methods as well, but we wanted to expand our knowledge, and try out different methods to call things into our main file.

We added a bunch of sleep and clear commands to make it prettier and seem more user friendly when the user runs the program.

We added Text to Speech commands to make it more interactive.

Authors


Yong Liang https://github.com/YongBong946/sorting-hat

Sam Ludwig

sorting-hat's People

Contributors

yongbong946 avatar

Watchers

James Cloos 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.