Back
Close

Mini Fish

Statement

 Goal

Fish, also known as ><> is an esolang (esoteric language) created by a user named Harpyon in 2009. The language itself is quite complicated to replicate as it is 2d with mirrors and reflections too. In this clash, you'll be creating mini fish, which is fish but with less features and is 1d.

number a number is from 0 to F. Push this number to the stack.
(Hexadecimal interpretation, but think on converting it to a decimal. Eg: 9F | stack: {9, 15})

n pops x off the stack and prints it without a new line
(Eg: 9n | stack: {} | stdout: 9)

+ pops x and y off the stack and pushes x + y on the stack
(Eg: 9A+n | stack: {} | stdout: 19)

- pops x and y off the stack and pushes y - x on the stack
(Eg: 9A-n | stack: {} | stdout: -1)

{9, 10}
| |
V V
9 - 10 = -1

* pops x and y off the stack and pushes x * y on the stack
(Eg 9A*n | stack: {} | stdout: 90)

Characters not present above to be ignored.

If there is no output, print "none" to the console.

If the stack doesn't have enough values to perform an operation

(Eg: 9+ | + needs 2 values since it's a binary operator, but the stack doesn't contain 2 so it errors), then print "no fishes" to the console. This should be overwritten by anything there is. So even if there is a valid operation before, but an invalid later on, you should still print "no fishes".
Input
Line 1 n: the length of the code/input.
Line 2 ins: the source code to interpret.
Output
Output if present, else "none".
Constraints
0 <
n
<= 50
The stack will be populated maximum by 50 values.
Example
Input
8
FFDD+++n
Output
56

Game modes
Fastest, Shortest

Test cases
Get you started Test
Input
8 FFDD+++n
Output
56

Validator 1 Validator
Input
14 AEFD634++++++n
Output
65

Countdown oO Test
Input
12 09+n91-n92-n
Output
987

Validator 2 Validator
Input
14 5n51-n52-n53-n
Output
5432

NO FISHES IN THE POND (╯°□°)╯︵ ┻━┻ Test
Input
25 92+n1()()234()()++&()+n1+
Output
no fishes

Validator 3 Validator
Input
43 123#4+++&^%$234++()()n123()()(((())))++@++n
Output
no fishes

NONE Test
Input
24 ED3*2E3F-B68A0*47DEF+BBA
Output
none

Validator 4 Validator
Input
28 8CF4AC962131+8C+028DE4EFAAC4
Output
none

Solution language

Solution

Stub generator input