Hacker News new | past | comments | ask | show | jobs | submit login

I couldn't find a Javascript environment for running this. Anybody knows if it exists?

If not, who's up for a github night ? ;-)




I've been thinking about creating one, having been an active Corewars player back in the day.

A problem could be compatibility with the pmars parser, which has been the standard for a long time. I tried writing a parser for corewars years ago and run into trouble emulating some aspects of the pmars parser.


yep I'm currently wrestling with it. I've a prototype that precompiles EQU and FOR/ROF and I'll try uploading it to github when it's a bit more tested.


Even a JS Corewars interpreter that can only compile "assembly" would be nice to have. Then people could compile their warriors with pmars and put fancy simulations on their web sites. Not saying that it is impossible to clone the pmars compiler, but it is a mess :-)


I've got the precompiler working quite well. Interestingly, it translates the redcode/pMARS code line-to-line to Javascript which is then executed to produce the assembly.

redcode is indeed a mess, clearly the result of an evolving and blurry standard :)

anyway, I'm spitting out assembly for 90% of the bots I've tried and have the Imp running. From now on it will indeed be a job of implementing each instructions and addressing modes. I'm definitely uploading this on github in a few hours and will be very happy to have some help ! :)


There you go !

https://github.com/joshfire/corewarjs

I've got imps and a few other running :)


Not exactly CoreWars in JS, but PDP11 in JS, with real Unix V6. Enjoy :)

http://aiju.de/code/pdp11/




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: