4 ms·
This reminds me that I once made a stupid game where you type code scraped from random github repos. The goal is to predict the next character that will appear.
by Houshalter 10y ago
This reminds me that I once made a stupid game where you type code scraped from random github repos. The goal is to predict the next character that will appear. The premise being that typing real code, and consciously trying to predict what will come next, forces you to quickly learn the syntax and style of a new programming language.
http://houshalter.github.io/perplex/perplex.html http://houshalter.github.io/perplex/perplex.html
- fapjacks 10y agoWow that is a very clever idea! It seems like though that I would get green letters even though I had never made a guess. For example punctuation, e.g. newlines and whitespace and dots, would be green instead of red, even though I'd not typed any character at all. Awesome idea nonetheless!
- Houshalter 10y agoOh yes, that was a feature I added. If you don't make a guess, it automatically guesses the most likely next character. You can see in the table to the left what it's predictions are. Which is just the letters most likely to appear after the last letter seen.
- fapjacks 10y agoOh, okay, that makes sense, then. So it's almost like I've got a computer partner that's also "learning" the syntax with me? That's actually really clever, because it helps me by demonstrating correct characters that I wouldn't have otherwise guessed. Very cool!
- Houshalter 10y agoIt was originally intended just to be a few hints to make it a bit easier. But I thought it made sense, that if you don't make any guess at all, it might as well guess the most likely character for you, and give you a few free points.
- curtisz 10y agoNeat! How is it predicting the next character?
- Houshalter 10y agoIt's based on markov chains of the characters most likely to come after the previous character.