Package maelstrom.funge.interpreter.stack

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


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

      long b = stack.pop();
      long a = stack.pop();

      if (b == 0) {
        stack.push(0);
      } else {
        stack.push(a / b);
View Full Code Here


  public static class Modulus implements Operator {

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

      long b = stack.pop();
      long a = stack.pop();

      if (b == 0) {
        stack.push(0);
      } else {
View Full Code Here

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

      long b = stack.pop();
      long a = stack.pop();

      if (b == 0) {
        stack.push(0);
      } else {
        stack.push(a % b);
View Full Code Here

  // Clones the first element on the stack
  public static class OutputChar implements Operator {

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

    public String getDescription() {
      return "Prints the ASCII value of the first element on the stack";
    }
View Full Code Here

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

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

    public String getDescription() {
      return "Prints the numeric value of the first element on the stack";
    }
View Full Code Here

     * Gets a value from the grid, pushes it to the stack
     */
    public void perform(Funge funge) {

      Stack stack = funge.getStack();
      long y = stack.pop();
      long x = stack.pop();

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

      stack.push(gridVal);
View Full Code Here

     */
    public void perform(Funge funge) {

      Stack stack = funge.getStack();
      long y = stack.pop();
      long x = stack.pop();

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

      stack.push(gridVal);
    }
View Full Code Here

     * Sets a value in the grid.
     */
    public void perform(Funge funge) {

      Stack stack = funge.getStack();
      long y = stack.pop();
      long x = stack.pop();
      long c = stack.pop();

      funge.getGrid().set((int) x, (int) y, c);
    }
View Full Code Here

     */
    public void perform(Funge funge) {

      Stack stack = funge.getStack();
      long y = stack.pop();
      long x = stack.pop();
      long c = stack.pop();

      funge.getGrid().set((int) x, (int) y, c);
    }

View Full Code Here

    public void perform(Funge funge) {

      Stack stack = funge.getStack();
      long y = stack.pop();
      long x = stack.pop();
      long c = stack.pop();

      funge.getGrid().set((int) x, (int) y, c);
    }

    public String getDescription() {
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.