Skip to content

Instantly share code, notes, and snippets.

@jxxcarlson
Created September 13, 2020 12:31
Show Gist options
  • Save jxxcarlson/4ff4ae9ad4fbe53f19814ed1efa63c06 to your computer and use it in GitHub Desktop.
Save jxxcarlson/4ff4ae9ad4fbe53f19814ed1efa63c06 to your computer and use it in GitHub Desktop.
# Elm Warrior: Notes
## Overall comments
The Dev.to article is very clear. Just a few very minor suggestions/comments below.
I did get some errors running `npm` (what's new?). The second error was
especially misleading/disconcerting, but it turns out that if you ignore it,
all is good. I was able to play the game.
Elm Warrior is a wonderful contribution to the community. I think it has
great potential to attract young people to Elm. Should be used in
meetups, code camps, competitions, etc.
PS. I'm not a game player. Nonetheless, I found Elm Warrior both fun
and fascinating.
## Running npm ci
I got the error message below when running `npm ci`
```
> fsevents@1.2.11 install /Users/jxxcarlson/dev/elm/tryout/elm-warrior-starter/node_modules/fsevents
> node-gyp rebuild
No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.
No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.
No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.
gyp: No Xcode or CLT version detected!
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack at ChildProcess.emit (events.js:315:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Darwin 19.6.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/jxxcarlson/dev/elm/tryout/elm-warrior-starter/node_modules/fsevents
gyp ERR! node -v v12.18.2
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
> parcel-bundler@1.12.4 postinstall /Users/jxxcarlson/dev/elm/tryout/elm-warrior-starter/node_modules/parcel-bundler
> node -e "console.log('\u001b[35m\u001b[1mLove Parcel? You can now donate to our open collective:\u001b[22m\u001b[39m\n > \u001b[34mhttps://opencollective.com/parcel/donate\u001b[0m')"
```
## Running npm start
I got the error message below. However, when I went to `localhost:4000`,
Elm Warrior was there.
```
$ npm start
> elm-warrior-starter@0.1.0 start /Users/jxxcarlson/dev/elm/tryout/elm-warrior-starter
> parcel serve --no-source-maps src/index.html
Server running at http://localhost:4000 - configured port 4000 could not be used.
```
## Making the warrior move
The directions were quite clear. I refreshed the browser,
and the warrior found the exit. Nice!
One thing that might be confusing is that once the Warrior
reaches the exit, the map changes, upping the level of
difficult with a new vertical arm. Perhaps a little
sentence about this. I assume that what will happen
is that the map will keep enlarging until it gets to its
final snail-like shape with a couple of turns. (The image
presented at the beginning of the article.)
((Please ignore this if all this is obvious to most people :smile:))
## Using the debugger
I tried this -- worked fine. Used it to experiment with the
opening of the new branch. When the warrior reaches the exit,
he is teleported back to the beginning and starts his journey
again, now with a map that has two parts, horizontal, then vertical.
Again, the overall idea might be good to mention. Seems to be
that as the user/player/programmer succeeds in each level (not
sure if this is the right term), the game restarts at that
level, with this process continuing until all levels are unlocked.
## Speeding things up
I slowed things down so as to watch more carefully!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment