Giter Site home page Giter Site logo

ac-ios-texttwist's Introduction

TextTwist

 .-----------------. .----------------.  .----------------. 
| .--------------. || .--------------. || .--------------. |
| | ____  _____  | || |     ____     | || |  _________   | |
| ||_   \|_   _| | || |   .'    `.   | || | |  _   _  |  | |
| |  |   \ | |   | || |  /  .--.  \  | || | |_/ | | \_|  | |
| |  | |\ \| |   | || |  | |    | |  | || |     | |      | |
| | _| |_\   |_  | || |  \  `--'  /  | || |    _| |_     | |
| ||_____|\____| | || |   `.____.'   | || |   |_____|    | |
| |              | || |              | || |              | |
| '--------------' || '--------------' || '--------------' |
 '----------------'  '----------------'  '----------------' 
 .----------------.  .----------------.  .----------------. 
| .--------------. || .--------------. || .--------------. |
| |   ______     | || |     ____     | || |    ______    | |
| |  |_   _ \    | || |   .'    `.   | || |  .' ___  |   | |
| |    | |_) |   | || |  /  .--.  \  | || | / .'   \_|   | |
| |    |  __'.   | || |  | |    | |  | || | | |    ____  | |
| |   _| |__) |  | || |  \  `--'  /  | || | \ `.___]  _| | |
| |  |_______/   | || |   `.____.'   | || |  `._____.'   | |
| |              | || |              | || |              | |
| '--------------' || '--------------' || '--------------' |
 '----------------'  '----------------'  '----------------' 
 .----------------.  .----------------.  .----------------. 
| .--------------. || .--------------. || .--------------. |
| |    ______    | || |   _____      | || |  _________   | |
| |  .' ___  |   | || |  |_   _|     | || | |_   ___  |  | |
| | / .'   \_|   | || |    | |       | || |   | |_  \_|  | |
| | | |    ____  | || |    | |   _   | || |   |  _|  _   | |
| | \ `.___]  _| | || |   _| |__/ |  | || |  _| |___/ |  | |
| |  `._____.'   | || |  |________|  | || | |_________|  | |
| |              | || |              | || |              | |
| '--------------' || '--------------' || '--------------' |
 '----------------'  '----------------'  '----------------' 

Plz don't sue, Hasbrah Parker Brahs.

Exercise

For this assignment, you will be making your own Boggle Text Twist clone using the magic of UITextFieldDelegate.

Data:

The following struct and class provides the data that you will be working with. Have your model choose one of the TestTwistInfo at random on startup.

struct TestTwistInfo {
    let wordCount: Int
    let letters: String
    let words: [String]
}


class WordData {
    static let allInfo: [TestTwistInfo] = [
        TestTwistInfo(wordCount: 27,
                      letters: "cdenno",
                      words: ["conned", "coden","coned", "donne", "nonce","code","coed","cone","conn","deco","done","neon","node","none","once", "cod","con","den","doc","doe","don","end","eon","nod","ode","one"]),
        TestTwistInfo(wordCount: 18,
                      letters: "ehhssu",
                      words: ["hushes", "shush", "hehs","hues","hush","shes","sues","uses", "ess","heh","hes","hue","huh","she","shh","sue","use"]),
        TestTwistInfo(wordCount: 14,
                      letters: "hisswy",
                      words: ["swishy", "hissy","swish", "hiss","whys","wish","wiss","ywis", "his","shy","sis","why","wis"])
    ]
}

Stage One:

  • Set up your UI with a text field (user input), a label (messages to the user) and 4 text views (where the correct words will be displayed)
  • When the user types in a guess into the text field and presses return, they get a message if their guess was correct, or had any errors and then it gets added to the appropriate spot in the UI.

Stage Two:

  • Create another label that represents the letter bank of available letters
  • Only allow the user to type letters that are inside the letter bank

Stage Three:

  • When the user types a letter, remove the appropriate letter from the letter bank label.

Stage Four:

  • When the user deletes a letter, add the appropriate letter back to the letter bank label.

Stage Five:

  • Present a message to the user if they guess a word that have already guessed before

Bonus One:

  • Add handling for the user guesses all 3-letter words, 4-letter words, 5-letter words or 6-letter words, by changing the background color of the appropriate text view

Bonus Two:

  • When the user guesses a six-letter word, display a message, then have the model change to another word

Bonus Three:

  • Implement a scoreboard. 3-letter words are worth 3, 4-letter words are worth 4 and so on. The scoreboard should persist as the user goes onto the next word

Bonus Four:

  • Improve the UI so that it looks polished
  • Add more sample words here

Full Requirements:

  1. Letter Bank: You'll need a letter bank for the user to select from. The letters should disappear or be greyed out when the user types it.
  2. Letter Checks: You must allow the user to type out only valid letters. Perform checks in your logic to prevent incorrect letters from showing up in your TextField.
  3. String Storage: Store valid words in word bank(s) once the user returns.
  4. Keyboard UI: Keyboard should resign when the user hits the Return key.

ac-ios-texttwist's People

Contributors

viczhong avatar benstone1 avatar samroman3 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.