Skip to content

kuuhaku0/AC-iOS-TextTwist

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

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.

About

Text Fields and Text Twist

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Swift 100.0%