Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Befunge
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Befunge-93 instruction list== {| |----- | width="10%" | <code>0-9</code> | Push this number onto the stack. |----- | <code>+</code> | Addition: Pop ''a'' and ''b'', then push ''a''+''b'' |----- | <code>-</code> | Subtraction: Pop ''a'' and ''b'', then push ''b''-''a'' |----- | <code>*</code> | Multiplication: Pop ''a'' and ''b'', then push ''a''*''b'' |----- | <code>/</code> | Integer division: Pop ''a'' and ''b'', then push ''b''/''a'', rounded towards 0. |----- | <code>%</code> | Modulo: Pop ''a'' and ''b'', then push the remainder of the integer division of ''b''/''a''. |----- | <code>!</code> | Logical NOT: Pop a value. If the value is zero, push 1; otherwise, push zero. |----- | <code>`</code> | Greater than: Pop ''a'' and ''b'', then push 1 if ''b''>''a'', otherwise zero. |----- | <code>></code> || Start moving right |----- | <code><</code> || Start moving left |----- | <code>^</code> || Start moving up |----- | <code>v</code> || Start moving down |----- | <code>?</code> | Start moving in a random cardinal direction |----- | <code>_</code> | Pop a value; move right if value=0, left otherwise |----- | <code><nowiki>|</nowiki></code> | Pop a value; move down if value=0, up otherwise |----- | <code>"</code> | Start string mode: push each character's ASCII value all the way up to the next <code>"</code> |----- | <code>:</code> || Duplicate value on top of the stack |----- | <code>\</code> || Swap two values on top of the stack |----- | <code>$</code> || Pop value from the stack and discard it |----- | <code>.</code> || Pop value and output as an integer followed by a space |----- | <code>,</code> | Pop value and output as ASCII character |----- | <code>#</code> || Bridge: Skip next cell |----- | <code>p</code> | A "put" call (a way to store a value for later use). Pop ''y'', ''x'', and ''v'', then change the character at (''x'',''y'') in the program to the character with ASCII value ''v'' |----- | <code>g</code> | A "get" call (a way to retrieve data in storage). Pop ''y'' and ''x'', then push ASCII value of the character at that position in the program |----- | <code>&</code> || Ask user for a number and push it |----- | <code>~</code> | Ask user for a character and push its ASCII value |----- | <code>@</code> || End program |----- | <code> </code>(space) || [[No-op]]. Does nothing |} Most one-dimensional programming languages require some syntactic distinction between [[comment (computer programming)|comment text]] and [[source code]] β although that distinction may be as trivial as [[Brainfuck]]'s rule that any character not in the set <code><nowiki>+-[]<>,.</nowiki></code> is a comment. Languages like [[Lisp (programming language)|Lisp]] and [[Python (programming language)|Python]] treat strings as comments in contexts where the values are not used. Similarly, in Befunge, there is no comment syntax: to embed documentation in the code, the programmer simply routes the control flow ''around'' the "comment" area, so that the text in that area is never executed.
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Befunge
(section)
Add topic