Awesome writeup!
Quick feedback wrt. light mode theme: the HLS message is printed in dark font on dark background (Safari on MacOS)
Thanks for the feedback. I fixed it by making it a json
code block (yup, that’s my hack). My website is held together with duct tape and I think that bumping a dependency has cascaded various issues. Another thing for my to-do list, I suppose.
The astute reader will observe that there are few issues with this implementation. The first is that this function is partial and will crash the game if you try to undo from the initial state. The second is that the score counter doesn’t count undos because undoing decreases the length of the list. We can fix both of these by just throwing some copies6 of the initial grid onto the end of the
grids
list whenever we undo.
I love this so much.
If you want to make this even more painful on yourself, you could try implementing SSR/Parabox-style undo, where you can also undo past a reset.
Thanks!
SSR/Parabox-style undos are totally possible, but if you support them, resets count toward your score. I did choose to call it “score” because I could calculate it arbitrarily, so that isn’t exactly an issue. It just goes against my personal game dev philosophy. I originally brushed it off because of that conflict, but now that you bring it up, it would be a pretty big QoL improvement for any accidental resets… I’ll have to rethink how attached I am to the way score is calculated.
It only takes two more characters to support those kinds of undos (can you spot the difference?), so to make it fit I could remove some characters from Lvl
or revert Level 13 to an alternate, smaller version. And then of course play Bin Packing again.
n="噞㋪㛃䚬摣ۜ㝜ቲ㜑昫⫛㍋勓ㅋ⩞䤤㱪㳃䊩㓛⤤㳝ᙪ㛅Ⳝ㩛㚙㛦䥢㔬㜞㋖⛍㣛戛㙉ኛ㙎ኛ孶抭安Ჭ㱉㚛㛛ᰛ⯙瞎㤅⛛牶䢯㛛㣠⭤㳳㑌䜜㚿㛛䜓缣㛚≣㶳ㅬ㛜㛛䛚㛛暛㛣⛛䤤䣤"
e('λ':c)|(a,b)<-span(>'n')c=u(u a#m 1 b)%e(y b);e(c:d)=c:e d;e l=l;k="λ.";m=take
v(x:_)=c x`mod`7;v _=0;l=print;s=[]:s;c=fromEnum;i="\no .#_λ+";y=drop 1;(%)=(++)
e&0=u.t;f&_=f;p=putStr;(1?f)x=z x%x;(5?f)x=y x%z x%z x;(i?f)x=(f&i$r e$f$head x):x
r=map;main=print=<<(mapM g.zip[1..].r(pure.words).lines$r(i!!).m 5.w=<<r c(n%x))
g(k,o)|any(elem '_')$head o=do{k!o;p b;i<-v<$>d;g(k,i?([t.u,t,id,t,t,t,r u]!!i)$
o)};g(k,x)=a x<$k!x<*p"↩"<*d;t=foldr(zipWith(:))s;z=m 1.u;w n=n`mod`8:w(n`div`8)
n!x@(s:_)=p"\^[cLvl "*>l n*>l(a x)*>p(unlines s);d=getLine;(_:r)#""=r%k;_#""="."
n#"."=n%k;(_:r)#"+"='.':r%k;_#"+"="..";('o':r)#"_"='O':r%k;l#x=x%l%"λ";u=reverse
a=length;b="λ:wasd 🔄:x 🔙:u\n";x="ᴔ翉䕿䤤䜣㛚㣛㢛䛳۳四⛛竛⛛笛⛛禣✤ባ⦉档✌䡣✌ቴ✙䤣✴㛛ۣ廛⛟盻⟛㛛⛛䌜⣡㞛⛳㣣✜幜⣏㛜ࣛ"
Edit: I wanted to add that one unanticipated joy of the tiny game jam is that I don’t feel (too) bad about just pasting a new version of my game into a comment reply.
Edit 2: updated my response and moved some rambly digressions to my blog post instead of further increasing the length of this reply.
Edit 3: added an explanation in an addendum.
What does “Must not include more than 2 consecutive characters” even mean? Taken literally it would mean your password must be at most 2 characters. Presumably they mean “abc” and the like.
You know, I had assumed it meant “2 consecutive identical characters,” but I’m not sure.
I also wasn’t sure of the restrictions enforced by “Must not include your Email ID partly or fully,” but it did allow me to register an account with the characters contained in my email so I would guess their “partly” means a consecutive substring of nontrivial length (say, greater than 3).
One of my banks does this - with just numbers!
Numbers only
Minimum 7 numbers
Maximum 20 numbers
Can’t have same number three times in a row (e.g. 111)
Can’t have four ascending or descending numbers (e.g. 1234 or 4321)
Can’t have the same number appear more than five times.
Can’t have pairs next to each other if the second pair is one number higher (e.g. 1122)
Can’t be the same as your previous eight access codes
Wow! How long do you think it will be before they start adding requirements like
The resulting number must contain at least three distinct odd prime factors
or
Must not contain your phone number partly or fully
Or contain your birthday, or any dates at all. In fact, it shouldn’t be divisible by 2 because most numbers are, and we want to make your password secure.
My bank’s password requirements for their “internet password” is laughable; 8 characters max., only lowercase alphanumeric characters. It gave me so many headaches to figure out which characters they actually accepted because they didn’t have any hints on what are the actual requirements…
It’s always the financial institutions*. An 8 character max is truly incredible. I don’t know much about storing passwords, but that kind of maximum makes me rather suspicious that they might be storing plaintext passwords…
That reminds me that I’ve had to enter my password for Fidelity over the phone using T9 codes (i.e. the chars “abcABC” all map to 2) and mapping all special characters to *. I know that they could be hashing the “simplified form” and storing it alongside my regular password when they receive it, but it certainly made me suspicious that they, too, were storing my password in plaintext. Of course they also have some archaic 16 character limit.
* which ironically are the ones for which I want the strongest password!
Hi. Troy Hunt has a good take on this and why it doesn’t matter.
https://www.troyhunt.com/banks-arbitrary-password-restrictions-and-why-they-dont-matter/
Thank you for putting my mind at ease over their strange password policies. I can feel justified in being upset and still reasonably confident in the security of my financial accounts :)
I feel like given how common “identity theft” is (people successfully tricking banks into thinking they’re you so the bank will authorize sending them money, which through linguistic judo turns a theft from the bank into a theft from you personally) this blog post isn’t really that strong of an argument. Especially the part about how the bank will pay for any “unauthorized transfers”. Good luck with that. Doubt the bank has ever paid out, and not because their security is that good.
Most identity fraud does not involve guessing banking credentials, it involves either compromising the endpoint or going through a weaker reset path. Strong passwords are intended to protect against offline attacks. If an attacker can get a server’s password database, then weak passwords may require only a few hundreds of thousands of guesses to get, which may be only a few seconds of compute time. For something like a bank, if an attacker is in a position to steal the password database, they are in a position to do a lot more (financial) damage.
it’s horrible! the other bank i use (which is the one i get my salary deposited onto) luckily has (slightly) better limits.. only 10 characters, but requires you to have at least 2 special characters and allows for uppercase.. but still leaves to desire
BBVA maximum is 6. Whenever you need to do something on the phone with them, they’ll ask for a couple of characters in random positions, but because the operators error once, I know they can see the whole password the whole time.
Haskell’s cousin PureScript requires explicit forall
. As a bonus, ∀
, the symbol (Vim digraph FA
), is supported by the compiler.
As is often the case, “There’s an extension for that”.
This makes me think of The Programing Language Wars, a thought-provoking* paper I read for a class. Skip to Section 2.2 if you - like me - generally don’t have the patience to casually read research papers.
* Jury’s out on the, erm, interesting choices of quotes.
If it’s actual code and not some super secret personal files, just get a free private repo on for example GitLab (no affiliation).
This would work, but because I’m switching between the two in the same house fairly often, pushing and pulling git repos is a bit more ceremony than I’d like.
How often are we talking? I have the same setup and I don’t find it too bothersome. It probably takes about 30s each to push and pull; plus I get the added bonus of knowing my changes are synced with a remote too (sometimes small justifications like these are enough to trick me into not complaining).
If I may suggest a kind of out-there alternate: you can ssh into the desktop. This was born out of necessity for me since my laptop is old and I was building a Big Repo. On a local network I don’t notice any lag, although there is the added caveat of ensuring your editor plays nicely with ssh.
The frequency can be random and switches must sometimes be done quickly to avoid children banging on my keyboard 😂
I think FP is awesome but I am saddened that this article does nothing more than present anecdotal evidence. In this regard I don’t think it’s more convincing than any other blog post touting the next programming panacea.
I am optimistic that in the near future we will have better qualitative and quantitative data on what it means to be a good programming language and whether existing languages are good.
I switched to Emacs from Vim a couple of years ago. To ease the transition I chose spacemacs because it offered evil-mode and had a lot of pretty good settings. However, it’s dog slow, even on a relatively beefy Macbook Pro. I even switched to using the latest version with native-comp, but no dice. Sometimes it even completely hangs when I edit python or go files. Have other people encountered the same issues? How do you fix them?
I’ve heard similar complaints from Spacemacs users; Spacemacs brings in so many things that it makes it hard to tell where a specific problem is coming from. Luckily it’s easy to use evil-mode on its own.
Have you tried Doom Emacs? I had similar issues you describe with Spacemacs, which caused me to switch to vanilla vim (yikes). A friend introduced me to Doom and it’s been pleasant. It feels batteries-included like Spacemacs, it has good evil support, and its rough edges haven’t been as rough as Spacemacs’s. My config files are pleasantly short and I believe that the legitimate configs (e.g. keybinds) outweigh the hacks (e.g. lsp parse failure workarounds).
My biggest issue so far is with lsp-mode choking on some inputs, but I kind of think it’s my fault.
My personal laptop is a 6-year-old Thinkpad running Linux, and Spacemacs is not at all slow. But six months ago I started a new job and they gave me a Macbook Pro M1 for work. I’ve been mostly impressed with the MacBook…superb screen, amazing battery life, and generally quite fast… except emacs seemed almost painfully slow, especially with Spacemacs. Installing emacs 28 and compiling all elisp to native code does improve things quite a bit, though.
I just have to ask the “is it plugged in” question: Have you checked you’re running an M1 build and not x86 via rosetta? (Some things get really slow when run via rosetta.)
How good are you with Emacs Lisp? Emacs has a built-in profiler – actually, there were two at one point! – which might at least help you figure out if there’s a specific culprit there, or if this is… just how fast the whole thing goes.
Folks in the Spacemacs community might also be able to help. I’m not familiar with it and I don’t use large configuration frameworks, but I get the feeling they have a very active community behind them.
Not to the same extent but I agree that Emacs is quite slow… for a text editor. Since it does so much more and is a Lisp interpreter underneath I guess that’s understandable, though still annoying.