mirror of
https://github.com/MaddyThorson/StrawberryBF.git
synced 2025-04-19 04:36:05 +08:00
33 lines
439 B
Brainfuck
33 lines
439 B
Brainfuck
|
namespace Strawberry
|
||
|
{
|
||
|
public enum Facings
|
||
|
{
|
||
|
case Right = 1;
|
||
|
case Left = -1;
|
||
|
|
||
|
public Facings Opposite()
|
||
|
{
|
||
|
if (this == .Right)
|
||
|
return .Left;
|
||
|
else
|
||
|
return .Right;
|
||
|
}
|
||
|
|
||
|
static public Facings FromInt(int i, Facings ifZero = .Right)
|
||
|
{
|
||
|
if (i == 0)
|
||
|
return ifZero;
|
||
|
else
|
||
|
return i;
|
||
|
}
|
||
|
|
||
|
static public implicit operator Facings(int i)
|
||
|
{
|
||
|
if (i < 0)
|
||
|
return .Left;
|
||
|
else
|
||
|
return .Right;
|
||
|
}
|
||
|
}
|
||
|
}
|