Tic Tac Toe vs Gemini AI on iOS | SwiftUI Tutorial

Описание к видео Tic Tac Toe vs Gemini AI on iOS | SwiftUI Tutorial

Learn how to create a Tic Tac Toe game with Gemini AI ! In this tutorial we’ll build a tic tac toe game using SwiftUI that you can play against Gemini AI. We’ll also implement a fallback mechanism for when AI responses are unavailable. Do you think you can beat AI in the game? Well, what are you waiting for?

📥 Detailed post:
https://www.anupdsouza.com/ios/ai/tic...

📥 Source code:
🔗 https://github.com/anupdsouza/ios-gem...

👉🏻 Get your Gemini API key to use with the SDK here:
🔗 https://makersuite.google.com/app/apikey
👉🏻 To know how to integrate the SDK, check out my previous video:
🔗    • Gemini AI on iOS with SwiftUI (Tutorial)  
OR read my post here:
🔗 https://www.anupdsouza.com/posts/gett...

📥 Gemini SDK package:
🔗 https://github.com/google/generative-...

📥 Game prompt:
"""
Introduction:
We are playing a game of tic-tac-toe in a 3x3 grid numbered with positions 0 to 8.
Position 0 is the top-left square, 4 is the center, and 8 is the bottom-right square.
I will place X & you will place O.
You win either by getting three Xs or Os in a row, column, or diagonally.
We will continue taking turns until there is a winner or the board is filled (a tie).
You will indicate your move by telling me the number (between 0 and 8) of the square you want to place your O.
Before each turn, you will be provided with the positions of X's & O's in the grid as an array of integers.
Check the existing positions of X's & O's in the 3x3 grid with the winning positions before making a choice.

Rules you must follow:
Rule #1. Inspect the grid for the position of X's and O's before deciding on a square.
Rule #2. If you are in a position to win, you MUST choose to win.
Rule #3. If I am in a position to win on my next turn, you must try and block my move.
Rule #4. If you can either WIN OR BLOCK me during your turn, you should choose to win.
"""

⏰ Timestamps:
00:00 Sneak peak
00:20 Setup models
01:26 Setup UI
03:12 Import Gemini SDK package
03:23 Setup game logic - computer
04:51 Setup game UI & wiring logic
19:00 Integrate Gemini AI
23:10 Game time!

📥 More Gemini AI with SwiftUI videos:
👉🏻 Get started with Gemini AI:    • Gemini AI on iOS with SwiftUI (Tutorial)  
👉🏻 Implement mult-turn chat (text prompts):    • Multi-turn Chat with Gemini AI on iOS...  
👉🏻 Implement multi-modal chat (text + image):    • Text & Image (multimodal) streaming C...  
👉🏻 Horoscope App with Gemini AI:    • Horoscope App with Gemini AI on iOS |...  
👉🏻 Murder Mystery Game powered by Gemini AI:    • Murder Mystery Game powered by Gemini...  
👉🏻 Storybook app powered by Gemini AI & Dall-E:    • Storybook app powered by Gemini AI & ...  
👉🏻 Chatbot in 15 mins on iOS using Firebase Gemini API Extension:    • Chatbot in 15 mins on iOS using Fireb...  
👉🏻 Multimodal Chatbot with Gemini using Vertex AI:    • Multimodal Chatbot with Gemini API us...  

📥 More info:
🔗 https://ai.google.dev/tutorials/swift...

✅ Consider SUBSCRIBING to the channel & giving this video a LIKE 👍🏼
🔗    / @swiftodyssey  
👉🏻 Click the BELL 🔔 icon to be notified of new content!

🌐 Follow me online:
🕸️ https://www.anupdsouza.com
🔗   / swift_odyssey  
👨🏻‍💻 https://github.com/anupdsouza

🎗️ Support:
☕️ BuyMeaCoffee: https://www.buymeacoffee.com/adsouza
🤝 Patreon:   / adsouza  
🙏🏼 Thanks for watching

🎶 Music:
Music track: Friendly Dance by Nico Staf
Music by Lidérc from Pixabay

🏷️ Tags: #ai #gemini #swiftui #iOS #google #firebase #vertex #vertexai #firebasetutorial #firestore #chatgpt #chatgpt4 #chatgpt4o #sora #bard #apple #ios #swift #swiftui #xcode #xcode13 #xcode14 #xcode15 #swifttutorial #swiftuitutorial #swiftbasics #swiftuibasics #swiftexample #swiftuiexample #uikit #uikitbasics #uikittutorial #swiftuianimation #tech #uikitanimation #animation #iosapp #mobilegame #swiftcode #iosappdevelopment #mobileappdevelopment #mobileapplications #mobileapps #mobile #developer #development #programming #programmingbasics #intermediateprogramming #advancedprogramming #swiftprogramming #swiftuiprogramming #design #uikitprogramming #code #coding #beginnerprogramming #ui #ux #beginner #intermediate #advanced #tutorial #iostutorial #programmingtutorial #codingtutorial #applicationdevelopment #objectivec #macos #macosdevelopment #macappdevelopment #iphone #iphoneappdevelopment #iphonedevelopment #iphoneos #ipados #iOS13 #iOS14 #iOS15 #iOS16 #iOS17 #iphone13 #iphone14 #iphone15 #iphonexr #iphoneplus #iphonepromax #iphonese #iphonepro #ipad #ipadmini #ipadpro #ipadair #simulator

Комментарии

Информация по комментариям в разработке