Skip to content

Comment on YOU_ARE_DEAD, a 1D Roguelike

Comments

My only objection is that it is unfairly hard for people with wide screens. I've made a narrower terminal because I got annoyed with having to play such a long level in order to make attempts at advancing the level (I've done it once by accident but not sure what I did).

EDIT: I've now figured out how to do it. Thinking I'd found all of the special rules I read through the source. There are some real gems in there :).

EDIT2: Huh, it looks like I was overthinking the level-advancing. There is no code for the problem I thought I was solving; I must have imagined it.

> EDIT2: Huh, it looks like I was overthinking the level-advancing. There is no code for the problem I thought I was solving; I must have imagined it.

Isn't this what `tput cols` is for? You advance to the next level when you reach the right edge of your current window, however wide your window is.

I thought you had to do some magic involving walking left for a little while before reaching the right edge. I'm sure a few times I reached the right edge only to be told I was dead.

It looks as though that was a bug which is now fixed. If your current level started with a . or a ~, you would die when you finished it (but that one wouldn't kill you at any other point). Now all levels start with a ' '.

Really? I read the source and it really is as simple as it looks, although there are some clever optimizations such as SCORE also being used to keep track of your current location.

I also like the CHOICE variable in which the probability of encontering a monster is decreased by adding more spaces.

  CHOICES="~.     "
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.