ssoelvsten / wordrow Goto Github PK
View Code? Open in Web Editor NEWA modern version of Text Twist
Home Page: http://wordrow.io
License: GNU General Public License v3.0
A modern version of Text Twist
Home Page: http://wordrow.io
License: GNU General Public License v3.0
In a welcome screen we should provide
We ought to make it easier for users to report a word, by linking directly to the language-specific issue .
That is much more satisfying that way
Since the on-click command just runs the type command, then we have some unexpected behaviour when having multiple occurences of the same letter.
Consider the following situation
_ _ _ _ _ _
L E I K P E
If the last E is clicked the following is expected to happen
E _ _ _ _ _
L E I K P _
But, what actually happens is
E _ _ _ _ _
L _ I K P E
Earliest version of the skip button (upper right) allowed you to see the solution. This should be provided once again, so you can give up and still see all words
Additional Context
Requested by my brother
We need a Rust program
To this end, we should reuse all of the .dic and .aff files available with Libre Office or similar. Here, we need to first parse the .aff file and create all of the finite state automata related to all the rules (that do not result in anything that does not introduce non-alphabetic letters). Then, we can in a single sweep go over the entire library and produce a stream of all possible words.
Each word is of the form ([a-z,A-Z]*)(?/.*)
. For example, the british dictionary includes
absurdity/MS
The M and S are keywords related to pre- and suffixes from the .aff file.
For each symbol A we have two or more lines. The first one is of the form
_FX A Y N
where N is the number of lines that follow with rules related to A. The lines that follow then can look as follows.
PFX A 0 re [^e]
PFX A 0 re- e
That is, prefix re if the start of the word does not match the regex [^e]
, i.e. if the word does not match [^e].*
. Otherwise, you may prefix with re-. A more interesting rule is the S suffix rule.
SFX S Y 9
SFX S y ies [^aeiou]y
SFX S 0 s [aeiou]y
SFX S 0 es [sxz]
SFX S 0 es [cs]h
SFX S 0 s [^cs]h
SFX S 0 s [ae]u
SFX S 0 x [ae]u
SFX S 0 s [^ae]u
SFX S 0 s [^hsuxyz]
Again, the first line is the number of rules that follow. The next line says that any word that ends with a y after some consonant then the y should be replaced with ies (e.g. academy turned into academies). The other rules append to the entire word, since they do not write any suffix of the given word.
Some of the requests in #38 are for words are due to bad affix rules having a do nothing branch . Examples are
/S,d,1,O,o
rules where S
, d
, O
, and o
have a do nothing rule (e.g. SFX o 0 / .
)./d,S,w,1,k
rules where d
, S
, and k
have a do nothing rule (e.g. SFX k 0 / .
).Task
!
)!
rule in .dic.
0 / .
with 0 /! .
We (may) need some way to explain how this game works for newcomers.
Pop-up
Auto Pop-up On First Visit
Content
We need an area of all the guessed and to-be guessed words.
Layout
During Play
At the end of the round
Since at that point it's a "give up the whole run" button
For the English version (both British, Australian, and American) we can use Collins Scrabble Words instead, as is available here
With the explanatory version, we also can obtain the type of the word (noun, verb etc.) to filter out any we do not want.
When in the menu and pressing a numeric key that is larger than the array languages, the game crashes rather than ignore the input.
Wordrow is not bad, but maybe we will find a better idea later. Here is a list of interesting words to use for inspiration.
From Wikipedia:
An anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once. [...] Someone who creates anagrams may be called an "anagrammatist"
The Jumble is a puzzle found in many newspapers in the United States requiring the unscrambling of letters to find the solution. [...] Multiple anagramming is a technique used to solve some kinds of cryptograms, such as a permutation cipher, a transposition cipher, and the Jefferson disk.[41] Solutions may be computationally found using a Jumble algorithm.
Furthermore, while in a different visual format this game is quite similar to a "Word Wheel' puzzle.
You may vote on multiple choices below
The user's input is in two parts:
During A Round
Space: Shuffle | Enter: Submit / Latest Word
End of a Round
Provide some text on whether one is qualified for the next round or not.
One can get stuck with some words left, one is unable to guess. At this point, it would be beneficial to provide hints.
One can either add a hint button at the top (❔) or integrate it into clicking on a yet to-be guessed word. The last one allows the player to better pick the word where they need a hint.
Tasks
Restrictions
This is primarily a problem in the developer version, since every game is 1/10 chance, but we might want to remember all games for the current session?
For some it is quite natural to write capital letters (since they are presented as such). Hence, we ought to allow this too.
I have been weirded out by the danish word ladd being created. It turns out to be the following rule combination:
lad from da-DK.dic
lad/10,47,39
47 from da-DK.aff
SFX 47 0 d/8,46,4,35,34 d +KONSONANT_FORDOBLING
Yet, this was only supposed to be used with the words created as the result of all the other rules. For example, with 8 we would add the ending
SFX 5 Y 8
SFX 5 0 es/34 . +GENITIV
SFX 5 0 ene/34 [^r] +PLUR_BEK
SFX 5 0 e/34 . +PLUR_UBEK
SFX 5 0 ne/34 er +PLUR_BEK
SFX 5 0 enes/34 [^r] +PLUR_BEK
SFX 5 0 nes/34 er +GENITIV
SFX 5 0 ene/34 [^e]r +PLUR_BEK
SFX 5 0 enes/34 [^e]r +PLUR_BEK
#Sammensætning, slut
COMPOUNDEND 34
That is, we only care to push the results from the leaves of the DFS traversal! To make our lifes simpler, we may want to prune the .dic and .aff file for the DONE rules.
It might be a good idea to clean up the entire dictionary code as requested in #17 .
The moon symbol that toggles light and dark mode moves between themes (or rather has different offsets). It would be nice if it didn't move.
If we store the best highscore in LocalStorage, then we can tell the user whenever something is a new personal best.
On mobile, the two rows can be quiet hard to hit
The game is lacking some satisfying sound effects.
Sound Effects
Buttons
Right now we use 'rem' for everything, but within the Game component we have to compute the grid layout based on pixel values. I would have higher confidence in there being no edge cases, if everything we had was in px instead (i.e. fix 1rem = 16px)
The following is a snippet of what is produced when applying a PFX rule
next_word |
ar.add |
ar.del |
ss.str() |
---|---|---|---|
airbrush | -/35 | -/35airbrush |
Luckily, there is only this -/35
rule, so it is not as pressing an issue.
By the following code:
import keyboard
import time
pos = list(input())
keyboard.wait('space')
sleep_time = 0
def press(s):
for c in s.lower():
keyboard.press_and_release(c)
time.sleep(sleep_time)
keyboard.press_and_release("enter")
def iter_press(pos, depth, s = ""):
if depth == 0:
press(s)
else:
for i, a in enumerate(pos):
iter_press(pos[:i] + pos[i+1:], depth-1, s+a)
for i in range(3, 6+1):
iter_press(pos, i)
Currently, the only feedback on submission of a word is that a new word blinks up. But, your eyes are focused on the input area. Hence, we ought to somehow provide feedback directly .
As an extra satisfying bonus when all words were guessed in a round.
Please write in comments below (as a tickmark, i.e. - [ ]
in Markdown), the words that you wish to be added or removed from the Danish dictionary. Alternatively, add a pull request, adding/removing that word or the rule that generates it.
When there are changes to any of these folders, then one should build the game and its dictionaries and deploy it to the gh-pages branch.
Since I just in 2fc91b1 added a root makefile to build the entire project, we really only need to copy over that one and do nothing else.
We need a string
size function that accounts for æ, ø, and å in utf8 being two letters in ASCII.
Right now, some players are quite stressed out even when having qualified for the next round. We should add some indication when qualifying for the next round.
Suggested by @mlutze : replace the Hunspell dictionaries with a simple list of all words. This has the following benefits:
Tasks
Touch or mouse support may be a good idea to do with some onClick
handlers on the input fields.
Please write in comments below (as a tickmark, i.e. - [ ]
in Markdown), the words that you wish to be added or removed from the English dictionary. Alternatively, add a pull request, adding/removing that word or the rule that generates it.
Weirdly enough, the 'A' in both the input and the guessed words is displayed as '_' and with an 'EN' underneath instead.
This happens on a Samsung phone.
When one zooms out, the Announcement Banner (currently only used for the "Round X" announcement) shifts its position and its height in relation to the grid of anagrams (it is supposed to cover three rows of anagrams).
You might be left with a lot of time for a round but no idea for the last few words.
That this piece of code was written at a GameJam really shows...
As shown on Stackoverflow one can make text unselectable in CSS. This would help us, especially when one plays with touch .
CharBox
mixin.With #9 we can generate the set of all words. To keep the amount of data low (and not need to program a backend) we will provide each individual game round, i.e. all anagrams for a single word, in its own file. That is, each game is in a JSON file of the form
{
"id": 42,
"language": "en_US",
"max_length": 6,
"anagrams": [
"gin",
"ins",
...,
"tin",
"gins",
"gist",
...,
"tiny",
"sting",
"tying",
"stingy"
]
}
It probably will be useful, if we can just assume the anagrams list is lexicographically sorted.
The easiest way to do so is to run an O(N2) algorithm on the entire dictionary (i.e. an O(N) algorithm for each word), but we can do better with data structures for anagrams:
Related to #16
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.