-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed spacing issues making the doc look ugly
- Loading branch information
aspwil
committed
Nov 21, 2020
1 parent
5143b5b
commit 2d0aa35
Showing
3 changed files
with
95 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,40 @@ | ||
/* | ||
* NDBall Simulator by Aspen Wilson is licensed under CC0 1.0. To view a copy of this license, visit https://creativecommons.org/publicdomain/zero/1.0 | ||
*/ | ||
|
||
//this class defines the Instruction object, it has no real maningful data, its just to group together data together | ||
package ndballsim; | ||
|
||
import java.util.Arrays; | ||
|
||
public class Instr implements Comparable<Instr> { | ||
|
||
//pos the position of the instruction in n-dim space | ||
public Pos pos; | ||
//the name of the instruction, this will be used to indentify what the instruction does during simlation | ||
public String name; | ||
//this array of objects will be used for extra info needed to be used when running specific instructions, such as memory cells or Y logic | ||
public Object[] info; | ||
|
||
//the constructer | ||
public Instr(Pos pos,String name, Object... inputs){ | ||
public Instr(Pos pos, String name, Object... inputs) { | ||
this.pos = pos; | ||
this.name = name; | ||
this.info = inputs; | ||
this.info = inputs; | ||
} | ||
public Pos getPos(){ | ||
|
||
public Pos getPos() { | ||
return pos; | ||
} | ||
|
||
@Override | ||
public String toString(){ | ||
return "Instr: "+name+", "+pos+", "+Arrays.toString(info); | ||
public String toString() { | ||
return "Instr: " + name + ", " + pos + ", " + Arrays.toString(info); | ||
} | ||
|
||
//this allows us to call collections.sort and sort by highest dim in an array list | ||
@Override | ||
public int compareTo(Instr instr) { | ||
return ((Integer)pos.getHighestDim()).compareTo(((Integer)instr.pos.getHighestDim())); | ||
public int compareTo(Instr instr) { | ||
return ((Integer) pos.getHighestDim()).compareTo(((Integer) instr.pos.getHighestDim())); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters