Package maelstrom.funge.interpreter.stack

Examples of maelstrom.funge.interpreter.stack.Stack.push()


          text = text + (char)in;
          in = System.in.read();
        }

        Stack stack = funge.getStackStack().getStack();
        stack.push(Long.parseLong(text));
      } catch (IOException err) {
        //TODO: Handle this exception as per spec
        err.printStackTrace();
      }
    }
View Full Code Here


      long y = stack.pop();
      long x = stack.pop();

      long gridVal = funge.getGrid().get((int) x, (int) y);

      stack.push(gridVal);
    }

    public String getDescription() {
      return "Pops b, then a from the stack. Pushes the value of grid square (a, b) to the stack";
    }
View Full Code Here

  public static class Clone implements Operator {

    public void perform(Funge funge) {
      Stack stack = funge.getStackStack().getStack();
      long a = stack.pop();
      stack.push(a);
      stack.push(a);
    }

    public String getDescription() {
      return "Clones the first element on the stack";
View Full Code Here

    public void perform(Funge funge) {
      Stack stack = funge.getStackStack().getStack();
      long a = stack.pop();
      stack.push(a);
      stack.push(a);
    }

    public String getDescription() {
      return "Clones the first element on the stack";
    }
View Full Code Here

    public void perform(Funge funge) {
      Stack stack = funge.getStackStack().getStack();
      long b = stack.pop();
      long a = stack.pop();

      stack.push(b);
      stack.push(a);
    }

    public String getDescription() {
      return "Swaps the first two values on the stack";
View Full Code Here

      Stack stack = funge.getStackStack().getStack();
      long b = stack.pop();
      long a = stack.pop();

      stack.push(b);
      stack.push(a);
    }

    public String getDescription() {
      return "Swaps the first two values on the stack";
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.