Javasc-ordle, making a JS function guessing game with React

Maybe we’re a bit late to the trend, but this week we had fun developing a wordle-esque game for guessing the output of hidden Javascript functions!

We’ve deployed it on Codesphere so that you can play it yourself here

How it works

Javas…


This content originally appeared on DEV Community and was authored by Saji Wang

Maybe we’re a bit late to the trend, but this week we had fun developing a wordle-esque game for guessing the output of hidden Javascript functions!

Image description

We’ve deployed it on Codesphere so that you can play it yourself here

How it works

Javasc-ordle(Working title) works by taking a github gist of a function, and blurring out the contents of the function.
The player then can guess different words to release them in the function.

Once the player believes they know how the function works, they can guess the output for the given parameter.

Let’s actually build it!

We built the game with React, you can check out the code here:

https://gist.github.com/LiorB-D/ef0f39e706be39c02e488058df6f02a5

As you can see, we start by pulling the gist and creating a version with redacted terms. Then we add functions to allow the player to guess both terms and the output, and perform the correct actions whenever they make a correct guess

Next Steps

Now we could probably do a lot more with this, including:

  • Adding a whole schedule of gists
  • Adding compatibility for multiple languages
  • Score-keeping

But this was a fun way to get started! Let us know if you want us to build this out more!

What’s your favorite wordle spin-off? Let us know down below!

Until then, happy coding from your friends at Codesphere, the swiss-army-knife every development team needs!


This content originally appeared on DEV Community and was authored by Saji Wang


Print Share Comment Cite Upload Translate Updates
APA

Saji Wang | Sciencx (2022-06-24T15:35:04+00:00) Javasc-ordle, making a JS function guessing game with React. Retrieved from https://www.scien.cx/2022/06/24/javasc-ordle-making-a-js-function-guessing-game-with-react/

MLA
" » Javasc-ordle, making a JS function guessing game with React." Saji Wang | Sciencx - Friday June 24, 2022, https://www.scien.cx/2022/06/24/javasc-ordle-making-a-js-function-guessing-game-with-react/
HARVARD
Saji Wang | Sciencx Friday June 24, 2022 » Javasc-ordle, making a JS function guessing game with React., viewed ,<https://www.scien.cx/2022/06/24/javasc-ordle-making-a-js-function-guessing-game-with-react/>
VANCOUVER
Saji Wang | Sciencx - » Javasc-ordle, making a JS function guessing game with React. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/06/24/javasc-ordle-making-a-js-function-guessing-game-with-react/
CHICAGO
" » Javasc-ordle, making a JS function guessing game with React." Saji Wang | Sciencx - Accessed . https://www.scien.cx/2022/06/24/javasc-ordle-making-a-js-function-guessing-game-with-react/
IEEE
" » Javasc-ordle, making a JS function guessing game with React." Saji Wang | Sciencx [Online]. Available: https://www.scien.cx/2022/06/24/javasc-ordle-making-a-js-function-guessing-game-with-react/. [Accessed: ]
rf:citation
» Javasc-ordle, making a JS function guessing game with React | Saji Wang | Sciencx | https://www.scien.cx/2022/06/24/javasc-ordle-making-a-js-function-guessing-game-with-react/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.