Skip to content

Instantly share code, notes, and snippets.

@Camto
Created May 31, 2021 04:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Camto/f28485653a688adfa78d239f068bc362 to your computer and use it in GitHub Desktop.
Save Camto/f28485653a688adfa78d239f068bc362 to your computer and use it in GitHub Desktop.
<style>
code {
background-color: lightgray;
padding: 2px;
border-radius: 3px;
border: 1px gray;
}
li {
margin-bottom: 3px;
}
</style>
<p>Welcome to my esolang ButtonLang!</p>
<button onclick="up()">+</button>
<p id="number">0</p>
<button onclick="down()">-</button>
<p>In ButtonLang, you are both the program and the interpreter. You may press the buttons to execute the ButtonLang program you want to.</p>
<p>Commands:</p>
<ul>
<li><code>+</code> Increment the accumulator.</li>
<li><code>-</code> Decrement the accumulator.</li>
</ul>
<script>
number = document.getElementById("number");
function up() {
number.innerHTML = (parseInt(number.innerHTML) + 1).toString();
}
function down() {
number.innerHTML = (parseInt(number.innerHTML) - 1).toString();
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment