|
@@ -585,7 +585,7 @@ class Stack {
|
|
* Swaps the top two values of the stack
|
|
* Swaps the top two values of the stack
|
|
*/
|
|
*/
|
|
SwapTwo() {
|
|
SwapTwo() {
|
|
- if(this.stack.length < 2) { throw new Error("Something's Fishy"); }
|
|
|
|
|
|
+ if(this.stack.length < 2) { throw new Error(); }
|
|
const popped = this.stack.splice(this.stack.length - 2, 2);
|
|
const popped = this.stack.splice(this.stack.length - 2, 2);
|
|
this.stack.push(...popped.reverse());
|
|
this.stack.push(...popped.reverse());
|
|
}
|
|
}
|
|
@@ -595,7 +595,7 @@ class Stack {
|
|
* Swaps the top three values of the stack
|
|
* Swaps the top three values of the stack
|
|
*/
|
|
*/
|
|
SwapThree() {
|
|
SwapThree() {
|
|
- if(this.stack.length < 3) { throw new Error("Something's Fishy"); }
|
|
|
|
|
|
+ if(this.stack.length < 3) { throw new Error(); }
|
|
// Get the top three values
|
|
// Get the top three values
|
|
const popped = this.stack.splice(this.stack.length - 3, 3);
|
|
const popped = this.stack.splice(this.stack.length - 3, 3);
|
|
// Shift the elements to the right
|
|
// Shift the elements to the right
|