This content originally appeared on DEV Community and was authored by dami
This is a submission for the Twilio Challenge
What I Built
I built an interactive Tic-Tac-Toe game called “Can You Beat Gemini? Tic Tac Toe.” This project allows players to test their skills against Gemini AI, providing a challenging and fun experience.
Demo
To See it in action, make a call to *+1 (806) *
Source Code
Can You Beat Gemini? Tic Tac Toe
Welcome to the Can You Beat Gemini? Tic Tac Toe project! This is an interactive Tic-Tac-Toe game where you play against an AI opponent named Gemini(Gemini API). The AI is designed to challenge your strategic thinking and make your Tic-Tac-Toe games more interesting.
Features
- AI-Powered Opponent: The AI, powered by Gemini, makes strategic moves to offer a robust challenge.
- Real-Time Game State Updates: The game board updates dynamically after each move, providing real-time visual feedback.
- Voice and SMS Integration: Use Twilio to handle user inputs via voice and SMS for an engaging experience.
- Session Management: Continuity in the game state across multiple moves using Laravel’s session management.
Prerequisites
- PHP 8.1 or higher
- Composer
- Laravel 11
- Twilio Account
Installation
-
Clone the repository:
git clone https://github.com/your-username/can-you-beat-gemini-tictactoe.git cd can-you-beat-gemini-tictactoe
-
Install dependencies:
composer install npm install
-
Set up environment variables:
TWILIO_SID=your_twilio_sid TWILIO_AUTH_TOKEN=your_twilio_auth_token TWILIO_PHONE_NUMBER=your_twilio_phone_number MY_PHONE_NUMBER=your_phone_number
-
Generate an application…
Twilio and AI
I used Twilio to get input from the user in digits (1-9), each representing a cell on the Tic-Tac-Toe board. Then, I used Gemini AI to play against the human user. Finally, I used the Twilio Messaging API (WhatsApp) to send the updated board when both AI and human players make their moves. I also used Twilio Functions to host the code.
Additional Prize Categories
Twilio Times Two
– The project uses Twilio Programmable Messaging (WhatsApp Sandbox), Twilio Programmable Voice and, Twilio Functions.
Entertaining Endeavors
– The project creatively combines a classic game with advanced AI technology, making it not just a simple Tic Tac Toe game but an engaging battle of wits against an AI opponent. By leveraging Twilio to receive user inputs and send real-time game updates via WhatsApp, the project ensures continuous engagement and keeps the players entertained throughout the game.
This content originally appeared on DEV Community and was authored by dami