Git Product home page Git Product logo

wordrow's Introduction

wordrow's People

Contributors

apersonh avatar dependabot[bot] avatar jaschdoc avatar lefreakie avatar mlutze avatar samantatarun avatar ssoelvsten avatar sweepline avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

wordrow's Issues

Welcome Screen

In a welcome screen we should provide

  • Game Title
  • Choice of language. To fully support pure keyboard input, we may want to number each language.
  • Press spacebar to start game

Transform into PWA

After #46 and #16 we have support for phones. To get it the final step, we can turn it into an offline phone App by turning the page into a PWA.

  • Add manifest
  • Reuse [W] icon for the splash screen.

First occurence of chosen letter is used rather than clicked

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

Show solution when finishing a round early

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

  • Use "fast forward" icon to "end round" when the round is still ongoing.
  • Use "next" icon (current) for "next round" when the round has ended.
  • If the round has not ended, end the round on click. If it has ended, then start the next round.

Additional Context
Requested by my brother

Parse and Filter Dictionaries

We need a Rust program

  1. Parse a dictionary file,
  2. Filter out all words that (a) include illegal letters or (b) are too long.
  3. Filter for "bad" words
  4. Add all the valid pre- and suffixes to each word.

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.

.dic files

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.

.aff files

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.

Fix en-GB | 🇬🇧 | Affix rules

Some of the requests in #38 are for words are due to bad affix rules having a do nothing branch . Examples are

  • "bas" has the /S,d,1,O,o rules where S, d, O, and o have a do nothing rule (e.g. SFX o 0 / .).
  • "mus" has the /d,S,w,1,k rules where d, S, and k have a do nothing rule (e.g. SFX k 0 / .).

Task

  • Add a new suffix rule for "do nothing" (use !)
  • Go over each affix rule and consider whether (based on some examples in .dic) the rule should be kept or removed. For the exceptions to this rule, where the base word should be kept, add the ! rule in .dic.
    1. If kept, replace the 0 / . with 0 /! .
    2. If not, remove said line

How-to Popup

We (may) need some way to explain how this game works for newcomers.

Pop-up

  • Icon On Upper Right to open it
  • Pop-up

Auto Pop-up On First Visit

  • Check LocalStorage for whether some or a new variable exists.

Content

  • da-DK
  • de-DE
  • en-GB

Words Area

We need an area of all the guessed and to-be guessed words.

Layout

  • For large games (and smaller screens) use single wrapping column.
  • If there is enough space available, then for each length of words there is a column.

During Play

  • Each word (if not guessed) is just some grey square with rounded corners.
  • When guessed, then the square is flipped over to contain the text and to be with green colours.

At the end of the round

  • Not guessed words are flipped to show the word underneath (but the background is still kept grey).

Alternative Name

Wordrow is not bad, but maybe we will find a better idea later. Here is a list of interesting words to use for inspiration.

  • Text : Word, Character, Letter, Alphabet, Type
  • Twist : Shuffle, Mix, Blend, Mingle, Meld, Jumble, Permute, Transpose

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.

Vote with emojis below

You may vote on multiple choices below

  • 😄 : Anagrammer (A person who anagrams, I guess)
  • 🎉 : Anagame / Anagrame
  • ❤️ Wodler / Lowder / Rowled (anagrams of wordle)
  • 🚀 : Word-Wheel (A different visual format for the same game)
  • 👀 Jumble / Wumble
  • 👍 : Word-Row / Wordrow (as it is now)

User Input Area

The user's input is in two parts:

During A Round

  • Current Input
    No initial proposal yet: see discussion below.
  • Available Letters
    • Each available letter is placed in a square with rounded corners, similar to Wordle.
    • Instead of moving letters, we will change the colour (font or background?) to mark them as chosen. We may also want to play around with the size of each letter.
  • Ability to shuffle and obtain the last word used.
    Instead of actually providing buttons, we will encourage using the keyboard by highlighting the shortcuts.

    Space: Shuffle | Enter: Submit / Latest Word

End of a Round

Provide some text on whether one is qualified for the next round or not.

Tips / Hints

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

  • Extend the game state with indices on hinted letters.
  • Extend the CSS of each word to only be green for the parts one has guessed.
  • Add callback to request a hint on-click.

Restrictions

  • The word gives (exponentially?) fewer points when it finally is guessed.
  • One should not get double points for guessing all words if hints have been used (?)
  • The six letter words should be unhintable (?)

Allow typing capital letters

For some it is quite natural to write capital letters (since they are presented as such). Hence, we ought to allow this too.

Intermediate words of the dictionary are also created

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

  • 8 from da-DK.aff
    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
    
  • 34
    #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 .

Fix sliding / moving theme button

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.

Personal Highscores

If we store the best highscore in LocalStorage, then we can tell the user whenever something is a new personal best.

  • Save Math.max of current LocalStorage and current run
  • Display on end-screen (with no new round) your prior personal best and whether you beat it.

Improve input rows on mobile

On mobile, the two rows can be quiet hard to hit

  • Increase the gap between the rows.
  • Make the button size as wide as is possible (i.e. some minimum in the width and a maximum size).
  • Add a margin around the entire game; this increases the gap between the browsers URL and the input row.

Add sound effects

The game is lacking some satisfying sound effects.

Sound Effects

  • On character typing: typewriter click
  • On new word success: typewriter ding

Buttons

  • Add mute button (top left next to dark mode)

Switch from rem to px

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)

Can be bruteforced

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)

Add visual confirmation/rejection in Input Area

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 .

  • If submitting a yet non-guessed word:
    Flash selection fields in green
  • If submitting an already guessed word:
    ?
  • If submitting a non-existent word:
    ?

Danish | 🇩🇰 | Word Addition/Removal Requests

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.

Create GitHuB Action to auto-build and deploy

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.

  • dict/
  • game/

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.

Convert dict/ into a Simple List of Words

Suggested by @mlutze : replace the Hunspell dictionaries with a simple list of all words. This has the following benefits:

  1. This will make it easier for people to create pull requests that add/remove words from the dictionary.
  2. This will make building the entire game much faster.

Tasks

  • Turn game_gen/dict.h into a separate Hunspell dictionary exploder: it generates all words from the dictionary, sorts them and then prints them out (without duplicates)
  • Turn game_gen/main.cpp into a simple read-file-and-populate-an-Anatree.
  • Convert dict/ into a simple list of words.

Touch/Mouse Input

Touch or mouse support may be a good idea to do with some onClick handlers on the input fields.

  • When clicking on an unselected character, 'type it'
  • When clicking on the selected characters, then 'untype it'
  • Add Clear button to the left of the submission row
  • Add Submit button to the right of the submission row
  • Add click on Endscreen to continue
  • Make the Skip button immediately go to the next round.

Letter displays 'A' as '_'

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.

Fix Height of Announcement Banner for Zoom < 100%

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).

Make text unselectable

As shown on Stackoverflow one can make text unselectable in CSS. This would help us, especially when one plays with touch .

  • Add this styling to the CharBox mixin.
  • Add this styling to the scoreboard.

Generate Game Instances

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:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.