MARIE-js / MARIE.js

MARIE.js is a simple, yet intuitive MARIE simulator built in JavaScript :pencil: and is used for teaching computing architecture and assembly language
https://marie.js.org
MIT License
144 stars 45 forks source link

Suggesting a quine as an example demo program #303

Closed jiaminglimjm closed 3 years ago

jiaminglimjm commented 3 years ago

Hi! I managed to write a quine as a side project in MARIE.js and it works (in unicode output mode)! I linked to the code and its "decompiled" version below. Do you think it would make a suitable addition to the list of example demo programs in marie.js.org?

I think it demonstrates two things, in that Marie programs are essentially lists of numbers and that you really can code anything with such a simple assembly language. Though I'm not sure if a self-printing program really makes the cut as an example demo program.

quine.mas quine_decompiled.mas

ericjiang97 commented 3 years ago

+1 from me.

jiaminglimjm commented 3 years ago

Here's a sample header for which the quine also works:

/ This is a quine, i.e., a self-printing program
/ by Jia Ming, allowed for use by the MARIE.JS Team
/ Copyright (C) 2021. Licensed under the MIT License
/
/ Note: Change output mode to unicode. For spoilers,
/ go to https://marie.js.org/?quine_decompiled
Hex 1063
Hex 22FF
Hex D2FF
Hex 6000
...

What do you think?

quine.mas quine_decompiled.mas

ericjiang97 commented 3 years ago

Awesome, can you create a PR for the example?

You can check out #291 which contains an example of adding MARIE samples

auroranil commented 3 years ago

PR has been merged. Closing issue.