WORDLE 2K
Word guessing game
2K plays
Based off of WORDLE by Josh Wardle
https://www.powerlanguage.co.uk/wordle/
Version 1.3
- Added 5 themes: Original, High Contrast, Bright, Ocean, RGB
Created: 01/15/22
Updated: 01/31/22
Sounds like "WORDLE TOUCAN", LOL.
noice
Recently achieved 2K plays ๐๐
Word guessing game
Updated to include 5 new themes: Original, High Contrast, Bright, Ocean, and RGB
woo i won by looking at google
wait, nvm i spoke too soon
it wont work for me anymore D:
Wow- a repl.it developer who updates their game based on suggestions? I am unironically impressed, nice job Frozones!
"keyboard" printout:
// only call this if you have already found a match for ch in guess_history // returns "match type" as a number (none, partial or full) int find_guess_history_optimistic(char ch) { size_t ghsize = 60; char *match = memchr(guess_history, ch, ghsize); switch (*(match - 1)) { case '0': return 0; case '2': return 2; } // we know for a fact the first match was a 1 (yellow) match // try to see if there's a more optimistic (better) match anywhere else while (ghsize > 0) { ++match; ghsize = 60 - (match - guess_history); match = memchr(match, ch, ghsize); if(match == NULL) return 1; if(*(match - 1) == '2') return 2; } return 1; } void print_keyboard(void) { static char const *row_qwerty = "QWERTYUIOP"; static char const *row_asdf = "ASDFGHJKL"; static char const *row_zxc = "ZXCVBNM"; for (int i = 0; i < 10; ++i) { char const *match = memchr(guess_history, row_qwerty[i], 60); int matchtype; if (match == NULL) // print row_qwerty[i] the default way else { matchtype = find_guess_history_optimistic(row_qwerty[i]); // print row_qwerty[i] using matchtype // 0 = no match (dark grey) // 1 = partial match (yellow) // 2 = full match (green) } } for (int i = 0; i < 9; ++i) // do the same for row_asdf for(int i = 0; i < 7; ++i) // do the same for row_zxc }
This is following from the last comment I wrote about how to better-manage the guess history, which is at the bottom of the other thread. In case you were confused about what guess_history
is.
char wordle[5]; ... if (random == 1) { wordle[0] = 'C'; wordle[1] = 'L'; wordle[2] = 'O'; wordle[3] = 'U'; wordle[4] = 'T'; } else if (random == 2) ... // this goes on for like 400 lines
there is a much easier way to do this, just saying
#include <string.h> char wordle[5]; static char const *dictionary[] = { "CLOUT", "POKER", "VISTA", ... }; ... size_t dict_len = sizeof dictionary / sizeof *dictionary; int random = rand() % len; memcpy(wordle, dictionary[random], 5);
No credit? Nowhere? This was made by Josh Wardle (https://www.powerlanguage.co.uk/wordle/) and was imitated here.
Really cool game! Reminds me of a TV-show we have in our country called Lingo!
Really cool
YEE
No Word Filter. Try to fix it!