Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<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