Inspiration
We saw lots of youtube videos of people playing ChatGPT in chess, and the moves it tried to get away with. We also saw how annoying it was to manually translate moves over from ChatGPT, so we thought we should remove the middle man.
What it does
Lets you play against openai's model "ChatGPT" in chess, although, because it's not trained for chess, it makes incorrect moves. We've coded our program to allow those moves for the AI only, while the user is stuck playing with the rules of chess.
How we built it
We used a flask backend, which uses selenium to mimic a user browser talking to chat gpt's website. The backend parses the move from the pages html and forwards the move to the frontend, which uses the Chess.js library to draw a chess board and get the user's next move.
Challenges we ran into
We first tried to use the OpenAI's api, but found out it had recently become paid. We then pivoted to training a model on co:here with data from chess games we found online. However, technical issues prohibited us from following that route. Finally, we created python scripts to mimic a user on the ChatGPT website and scraped the moves from the html on the webpage.
Accomplishments that we're proud of
- Allowing the chess library to take illegal moves from only one user.
- Getting access to ChatGPT through the website instead of the API.
- The home and lost screen
What we learned
A ton. How chess.js works, what fen notation is, and how to read webpages to get around the login on the OpenAI website.
What's next for Illegal Chess
Making the site more able to handle more than one game, expanding the insight feature, fixing edge case bugs where chatGPT does not answer in a correct format, difficulty levels, spectate, and clearer win conditions
Built With
- chess.js
- flask
- javascript
- openai
- python
- selenium
- undetected-chromedriver
Log in or sign up for Devpost to join the conversation.