Code Monkey home page Code Monkey logo

cf98c's Introduction

CF98C

Concurrent Funge-98 Compiler - A compiler (written in C) for Concurrent Funge-98

Usage: cf98c [source]

[source]: A file containing a program written in Concurrent Funge-98

Current instruction set

  • 0-9 Push this number on the stack
  • a-f Push the integer value 10-15, respectively, on the stack
    • Addition: Pop a and b, then push a+b
    • Subtraction: Pop a and b, then push b-a
    • Multiplication: Pop a and b, then push a*b
  • / Integer division: Pop a and b, then push b/a, rounded down. If a is zero, ask the user what result they want.
  • % Modulo: Pop a and b, then push the remainder of the integer division of b/a. If a is zero, ask the user what result they want.
  • ! Logical NOT: Pop a value. If the value is zero, push 1; otherwise, push zero.
  • ` Greater than: Pop a and b, then push 1 if b>a, otherwise zero.
  • Start moving right

  • < Start moving left
  • ^ Start moving up
  • v Start moving down
  • ? Start moving in a random cardinal direction
  • _ Pop a value; move right if value=0, left otherwise
  • | Pop a value; move down if value=0, up otherwise
  • " Start string mode: push each character's ASCII value all the way up to the next "
  • : Duplicate value on top of the stack
  • \ Swap two values on top of the stack
  • $ Pop value from the stack and discard it
  • . Pop value and output as an integer
  • , Pop value and output as ASCII character
  • Trampoline: Skip next cell

  • k Pop a value n; perform the next instruction n times
  • p A "put" call (a way to store a value for later use). Pop y, x and v, then change the character at the position (x,y) in the program to the character with ASCII value v
  • g 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
  • & Ask user for a number and push it
  • ~ Ask user for a character and push its ASCII value
  • @ End program

References

Befunge: http://en.wikipedia.org/wiki/Befunge

Funge-98 final specification http://quadium.net/funge/spec98.html

cf98c's People

Contributors

bgradin avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.