Welcome to the third and last demo of this lesson. In this demo, you’ll implement the Blitz mode. This is the third and final feature that is missing from the game.
Blitz mode relies on fast guessing before the hint disappears. Basically, each hint shows up for a certain period of time. If you don’t guess within this time window, it automatically moves forward to the next hint, and the score that you can achieve is reduced. Let’s put the prompt and then I’ll read it.
This app doesn't implement the Blitz mode. Implement the feature following the description of this game mode. Users can see one clue for a maximum time of 20 seconds. Once the time expires, the next clue is shown automatically. Users can't go back to see the previous clue. The idea is users will have to read the clues in this time and also remember them to make the guess. The point system changes now. It will be 40, end of first clue, 30, end of second clue, 20, end of third clue, 10, end of the fourth clue. In this mode, users get the opportunity to score more points. Maximum points for each round will be 40 now instead of 20 in the standard mode.
Of course, before reading the prompt, if you haven’t done that in the first lesson, make sure that you have the project open, and I’m using the Auto for the model to execute. Let’s start the implementation.
Here we go. Implementation is done, but Cursor is asking your permission to build the project. IDEs will always ask permission if they’re doing a task that is external, using an external tool, or attempting to modify something outside of the sandbox. More on that on later modules. For now, let’s select Run. It’s asking for another step. If you choose Always Run, it will take as remember this command to always approve. Here are the notification. Here are the diff across all the different files.
Let’s go to Xcode and build the app. Build and Run. Here’s the simulator. Let’s choose the Blitz mode that we just implemented. Let’s begin. This landlocked country has four official national languages. I think this is Switzerland. That was correct. Next country. This country is shaped markedly like a boot. This is a hard one. Maybe this is Brazil. Nope. See, the counter has reset back to 17 seconds, but this one is actually Italy. And also, since this is the second hint, the score has reduced. Let’s write Italy quickly. Yes, this is correct. This country covers nearly half of an entire continent. This time, Brazil is the correct answer. Submit guess, 40 points. Let’s stop for now. Total score is correctly 110, 40, 30, and 40.
To give a quick comparison between Cursor and Xcode. In Cursor, you can have multiple workspaces in the same window. You can have multiple conversations for each workspace. Each workspace is basically a different project. In other words, you can easily navigate between parallel tasks running on different projects, and it’s not necessary iOS, macOS, tvOS, or an iPadOS application. You can have a Vapor application if you want, any technology, and run the agent across them.
With Xcode, you can also have multiple conversations, but if you want to have multiple projects, you will have multiple windows open. So it might be complicated to navigate across all of them, but Xcode is mainly for Apple platforms, iOS, macOS, et cetera. But again, Cursor is not specific to Apple platforms. You can work on any projects in parallel. You can even have an essay being written through it, but I don’t recommend letting it write your homework.
In the next lesson, you’ll learn how to empower the AI agent to take control over your application, whether for testing or for whatever you want from it. In Xcode, it’s straightforward, but for external IDEs like Cursor or others, there is an additional step that you need to do, which is called connecting an MCD. More on that in the next lesson. See you then.