This story will be constantly updated. You can use the menu to go directly to the last item.
I once programmed, really coded: an unbeatable cute cat game called “Clumsy Karate Cat” for Android and Apple phones. It was the designated successor to Flappy Bird, waiting to be downloaded by the masses. And it waited and waited and waited for it to be removed from both app stores. Unfortunately, I had to learn that marketing is everything. The cutest cat won’t help.
Not only the game has disappeared from the shops, but also my rudimentary knowledge of programming. At that time I was able to use a programming interface called “Corona”. The surface, as you can guess, no longer exists under that name. All that remained was my frustration that I never really learned to program. Neither HTML nor Javascript.
But now with ChatGPT there is an artificial intelligence that does the tedious programming work for me. At least that’s what the exuberant tweets tell me about the upgrade to version 4. And as so often these days, I’m taking on a challenge: Can I do it tonight (almost) without any programming knowledge with ChatGPT Tic-tac-toe game computer programming?
Wish me luck!
What the many enthusiastic tweets don’t say: Chat GPT-4 is smart, but not a racehorse. Because I’m pressed for time, I decide to make a first version with GPT-3.5. It can’t be that hard…
I try the following prompt:
The background must be black.
The grid of the playing field and the playing pieces must be pink.
The player plays against a computer opponent.
The player always starts.
When the game is over, it should be stated who won – or if there was a tie.
A button should appear below it to start a new game.
It should have the following caption: “Start a new game”.
GPT-3.5 works like Valentino Rossi and writes me code in seconds.
But what good is the code? I build it into our homepage, which thanks to our content management system (CMS) is child’s play, even for a layman like me. And voila!
function startGame() { gameStatus=""; currentPlayer="X"; squares.forEach(square => square.innerHTML = ''); document.getElementById('message').innerHTML = ''; }
function handleMove(e) { const clickedSquare = e.target; if (gameStatus !== '' || clickedSquare.innerHTML !== '') return; clickedSquare.innerHTML = currentPlayer; if (checkWin()) { gameStatus = `${currentPlayer} hat gewonnen!`; } else if (checkTie()) { gameStatus="Unentschieden!"; } else { currentPlayer = currentPlayer === 'X' ? 'O' : 'X'; } document.getElementById('message').innerHTML = gameStatus; }
function checkWin() { return winningCombinations.some(combination => { return combination.every(index => { return squares[index].innerHTML === currentPlayer; }); }); }
function checkTie() { return squares.every(square => square.innerHTML !== ''); }
for (let i = 0; i < 9; i++) { const square = document.createElement('div'); square.classList.add('square'); square.addEventListener('click', handleMove); board.appendChild(square); squares.push(square); } document.getElementById('new-game').addEventListener('click', startGame); startGame();
aaaaaaaaaaa
With my HTML element I destroy the layout of our beautiful news page. Ha! The tingling feeling of power arises, because everyone knows: whoever wants to create must also be able to destroy! Or something.
But now the sales team is behind me and listening. That's how quickly omnipotence turns into powerlessness. I feel like Goethe's sorcerer's apprentice. How the hell do I get rid of the ghosts I called?
And above all: what has Chat-GPT 3.5 programmed here? The rendering of the playing field is reminiscent of a Basquiat painting and there is no computer opponent either. But I'll have to take care of that later. Now I need to get our watson layout back in order. Otherwise I will be quickly banned from trying here.
Wish me luck! Now I really need it!
Source: Watson
I’m Ella Sammie, author specializing in the Technology sector. I have been writing for 24 Instatnt News since 2020, and am passionate about staying up to date with the latest developments in this ever-changing industry.
On the same day of the terrorist attack on the Krokus City Hall in Moscow,…
class="sc-cffd1e67-0 iQNQmc">1/4Residents of Tenerife have had enough of noisy and dirty tourists.It's too loud, the…
class="sc-cffd1e67-0 iQNQmc">1/7Packing his things in Munich in the summer: Thomas Tuchel.After just over a year,…
At least seven people have been killed and 57 injured in severe earthquakes in the…
The American space agency NASA would establish a uniform lunar time on behalf of the…
class="sc-cffd1e67-0 iQNQmc">1/8Bode Obwegeser was surprised by the earthquake while he was sleeping. “It was a…