Package maelstrom.funge.interpreter.stack

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


  // Clones the first element on the stack
  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() {
View Full Code Here


  // Swaps the first two values on the stack
  public static class Swap implements Operator {

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

      stack.push(b);
      stack.push(a);
    }
View Full Code Here

  public static class Swap implements Operator {

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

      stack.push(b);
      stack.push(a);
    }
View Full Code Here

  // Pops and discards a value off the stack
  public static class Pop implements Operator {

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

    public String getDescription() {
      return "Pops and discards a value off 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.