Make your own NYT Connections game
My wife loves playing the NYT Connections game, and around Christmas she asked me to make her her own version. So I sat down one weekend and did it without knowing a bit of css, javascript or html. I built it with the help of ReplitAI Chat, from start to finish.
Here’s a demo of the finished product:
Adapt my code and run your own version
One very cool thing about Replit is that we make it dead simple for you to take someone else’s code, and run with it.
If you’d like to do this with my Connections game:
Go here (
https://replit.com/@lpettingill/Connections-Demo#main.py)
Click ‘Fork and Run’ in the top right
if you are already a Replit User, sign in
if you are not a Replit User, sign up
You’ll then be dropped into my Repl— that’s what we call code projects at Replit
the project may need a few seconds to ‘warm up’ so be patient
click the ‘Run’ button. You’ll see the app running in the ‘Webview’ in the top right window
you can open it in a new tab by clicking ‘New Tab’ and play the game there.
To adapt the demo with your own categories, you’ll need to edit the
categories.py
file. That file (in the pane on the left) has a dictionary in it calledall_categories
where we define categories.Once you’ve updated the categories, click the ‘Run’ button, open up the webview, and you should be good to go with your adapted version!
Hot tip: Replit has a cool AI feature called ‘Explain’ which will explain code to you. Select the code in categories.py (or anywhere in the repo), right click, then select ‘Explain’, and you’ll get an explanation of what this code is doing.
To share your version or play it on the go, you’ll need to deploy it
This is the fun part: sharing what you’ve built! Once you’re ready to share:
Click the button in the bottom left that says ‘+ Open new tab’
Under Tools click ‘Deployments’, click ‘Autoscale’.
Deployments use compute resources in the cloud, and are not free (sorry!), so you’ll need to add a credit card for ad-hoc usage billing OR subscribe to Replit Core which includes credits for Deployments (and includes our best AI models and features).
Billing occurs monthly or once your accumulated costs reach $10. If you’re just sharing this tiny app w a small group friends and family you may never reach that $10. See here for more details.
Pending screen size you may have to scroll down a bit, but confirm your selection by clicking ‘Set up my Deployment’
On the next screen you can probably turn ‘machine power’ and ‘max number of machines’ down to the lowest settings (unless you think your game will go viral/have a lot of users at one time), confirm by clicking ‘Approve and configure build settings’
Next, you can specify your domain in the ‘Primary Domain’ field.
copy it!
After that, your deployment will be set up and once ready, you can go the deployment url you copied and share it w your friends. Yay!
Make your app better than mine
I made this app pretty quickly, and there is lots of room for improvement. You could password-protect access. You could make the app have a ‘state’ which would allow you to pick up and replay the same game, or give everyone who plays the exact same game. You could limit it to one play a day. You could even (gasp) change the colors.
To do any of this, just use ReplitAI by selecting ‘AI’ in the Tools menu, and telling the AI what you need, or asking it a question. Once you ask for help, you’ll get an overview and then code you can integrate directly into the existing code:
To set expectations, this AI is good, but no AI is perfect. You may have to futz around a little bit, but if I can do this anyone can.
Have fun!