8 ms·
The Unix Game
- howolduis 5y agoCan't scroll on the "Your solution" box. Browser: Firefox
- moyix 5y agoI would love to be able to just type the command line in; dragging blocks around is really slow and unnatural. But probably I'm not the target audience...
- bombcar 5y agoit reminds me of the early LEGO robotics programming setup - and how NQC (not quite c) was much easier to use for those with familiarity with programming. Part of the problem is there are hundreds of ways to use unix tools to get the correct response, so you'd need an entire shell and output parsing to prevent frustration.
- EamonnMR 5y agoThey also used that block-code setup for a game, Stormrunner where you control a robot with the mindstorms block language. Kind of like Logo but with sweet graphics. http://biomediaproject.com/bmp/files/LEGO/gms/online/Mindstorms/Stormrunner/Stormrunner/start-frameset.html http://biomediaproject.com/bmp/files/LEGO/gms/online/Mindsto...
- necovek 5y ago> Part of the problem is there are hundreds of ways to use unix tools to get the correct response, so you'd need an entire shell and output parsing to prevent frustration. I think that's part of the beauty! But you could still support only some common POSIX tools, basically, the ones they've got "blocks" to pull from. If I could type these in, I'd have a lot more fun — this way, I gave up after the intro questions because it's so time consuming.
- linkdd 5y agoIt's something I would give my interns to learn how to use the command line and how it's supposed to work. I've found some very good interactive tutorial for Git and such, and it works very well for teaching/learning.
- trey-jones 5y agoMy thoughts exactly. Furthermore, this would be great training/practice for eg. Linux Foundation certifications with just the questions and "here's a terminal, go solve it".
- robsws 5y agoI figured that was just a convenient way to avoid all the security problems that come with exposing a shell online whilst also limiting the inputs, although I'm sure there's other ways to do that. Might be nice to have the option I guess.
- simlevesque 5y agoThat is freaking awesome.
- bear8642 5y agoSeems cool - though feel way to hide welcome pane would be nice as seems unnecessary once started and no obvious way to hide
- tux3 5y agoA small bug report: If I enter 0 as an input number in one of the commands, I get a Javascript stack trace in the console :] TypeError: blockMap[arg].value.replace is not a function at /home/ubuntu/unix50/web/src/webserver.js:1032:182 at Array.map (<anonymous>) at /home/ubuntu/unix50/web/src/webserver.js:1032:50 at Array.forEach (<anonymous>) at buildUnixCommandVertical (/home/ubuntu/unix50/web/src/webserver.js:1025:18) at buildUnixCommand (/home/ubuntu/unix50/web/src/webserver.js:920:20) at /home/ubuntu/unix50/web/src/webserver.js:1042:19 at Layer.handle [as handle_request] (/home/ubuntu/unix50/web/src/node_modules/express/lib/router/layer.js:95:5) at next (/home/ubuntu/unix50/web/src/node_modules/express/lib/router/route.js:137:13) at Route.dispatch (/home/ubuntu/unix50/web/src/node_modules/express/lib/router/route.js:112:3) Edit: ooh and it's vulnerable to shell command injection... and the VM has internet access. Problem reported.
- cbsmith 5y agoMaybe it's just me, but I was already turned off by the use of "cut" in the first question in a way that assumes all the names in the file have exactly one space and exactly two names.
- 613style 5y agoI think there's two parts to this: first, if you know your input meets certain constraints, then there's no benefit to over-complicating the solution. Second, this is a teaching tool. It makes sense to start simply and save the harder version for later.
- cbsmith 5y agoIs it really so awful to do "grep -o '\b\w+%'"? It still won't handle extra space padding at the end of the line, but it's still a lot less ugly than assuming the word after the first space is a last name.
- cbsmith 5y agoWeird, not sure why it did % instead of $ there.
- RasmusLarsen 5y agoIn the context of trying to teach people basics, yes, I would argue that is quite awful.
- samatman 5y agoIt's a game. I'd be more bummed if a game gave me five lines of sample data which fit the constraint of "exactly one space and exactly two names", and then the rest of the data violated that constraint. Or if some of the last names didn't start with a capital letter, like d'Azzo, for that matter.
- tasogare 5y agoSame thought here. Processing text with cut and pipes is cute and works when data are regular except in real life there is often lines here and there breaking assumptions. Using a programming language offer way more possibilities to deal with pathological cases.
- deleted 5y ago[deleted]
- Lex-2008 5y agolooks cool! BUT: 2nd question in "hello_world/" expects two last names in a very specific order. If I sort them - it considers answer to be invalid. But should it?
- murgindrag 5y agoI'd like a tutorial mode, where: 1) Only the commands you need are available. 2) They are explained. I find myself using the commands I know well. This would be a nice tool for learning command I don't know well.
- moyix 5y agoIf you hover over the command it will give a brief summary. The selection of commands and patterns does change slightly for each "level".
- dang 5y agoOne past thread: The Unix Game - https://news.ycombinator.com/item?id=21249792 https://news.ycombinator.com/item?id=21249792 - Oct 2019 (65 comments)
- moyix 5y agoBug in turing_awards Q1: input.txt doesn't include the first 4 lines of the file (which are shown in the flavor text). So you have to trick it into giving the right number instead of doing the obvious grep | wc -l :p This also makes Q2 unanswerable unless you can figure out how to construct Alfred V. Aho from scratch...
- btheeten 5y agoGood catch! That was indeed a bug. Should be fixed now. Thanks for reporting.
- deleted 5y ago[deleted]
- ncmncm 5y agoBugs: First, RNA does not have T (thymine) bases, it uses U (uracil). Second, the bases between 3' and 5' have to come in threes; the game only admits [ACGT]*, not [ACGT]{3}* (never mind [ACGU]{3}*). Third, it treats any form of the latter, constructed purely via its block stacking, as a syntax error, which should be impossible to construct that way.
- jarv 5y agoThis is pretty cool, looks similar to something I built awhile back (https://cmdchallenge.com https://cmdchallenge.com), would love to know more details on how you built the backend, how you are sandboxing commands, if you are doing any caching, etc.
- threeio 5y agoI prefer your version :)
- hobojones 5y agoA few years back while working as a Linux admin I sent this to a newish co-worker who was struggling. They were an older Windows/DOS person and had little familiarity with UNIX. I thought this would be an easy way to practice completing tasks via shell and to demonstrate the possibility therein. I checked in a few weeks later and my co-worker never went past looking at the first page and saying 'This looks neat' - unsurprisingly they were let go about two months after I left.
- Anthony-G 5y agoI did the first four exercises and like the concept a lot. It reminds me of Scratch and I think it would be a great way to learn how Unix tools can be combined to form powerful pipelines. The only thing I dislike is that it encourages the infamous “useless use of cat” anti-pattern.