2D Lists: Connections #
This lab utilizes 2-dimensions lists to create the New York Times game, Connections.
Syllabus Topics [SL] #
- B2.2.2 Construct programs that apply arrays and Lists.
[0] Set up #
๐ป Go into your unit folder and clone your repo.
Be sure to replace yourgithubusername with your actual username.
cd ~/desktop/dpcs/unit02_data_structures
git clone https://github.com/isf-dp-cs/lab_connections_yourgithubusername
cd lab_connections_yourgithubusername
๐ป Enter the Poetry Shell to start the lab. As a reminder, we will run this command at the start of each lab, but only when we are inside a lab folder.
poetry shell
๐พ ๐ฌ Exiting the poetry shellWhen you want to exit the shell, you can type
exitor^D
[1] System Overview: Diagram #
This how your command line user interface should be designed for the connections game.
Display the board as a 4x4 grid of randomly arranged words..
ram | marker | mug | pencil
cup | cpu | crayon | pear
kiwi | ssd | orange | glass
gui | pen | apple | bottle
A user inputs a guess for a category by typing each word, separated by a space
Enter guess, separate items with a space: apple kiwi pear orange
If they were successful, it displays the category.
Found the category: fruits
If they were unsuccessful, it displays a message.
Category not found...
If a category is found, it removes those words from the board.
cpu | ssd | pencil | pen
bottle | marker | gui | ram
glass | mug | crayon | cup
A message to communicate when the game is won
Congratulations on finding each category!
[2] Development #
๐ป Construct code to complete each success criteria to build a command line version of Connections.
- The guessable words from each category are scrambled and displayed as grid with 4 columns
- The user inputs their guess of four words for a given category, receives feedback on their guess, and can guess until they find all four categories
- When a user find a category, that category is removed from the board that is displayed
โ๏ธ Go to your Google Drive and open the “Connections Worksheet” document. Take screenshots of your implementation and explain how you constructed it and why.
โกโจ Once you complete the lab, be sure to complete these two steps:โ๏ธ Go to your Syllabus Content Checklist in your Google Drive and update it accordingly.
๐ป Push your work to Github
- git status
- git add -A
- git status
- git commit -m "describe your code here"
- git push
- remote