Switch
58pages on
this wiki
this wiki
A switch statement is FiM++'s way of compressing code for the programmer and making if-then-elseif-then chains more readable by the reader.
Related Phrases
Edit
-
In regards to
-
On the
-
hoof
-
nd hoof
-
rd hoof
-
st hoof
-
th hoof
-
-
If all else fails
-
That's what I did
FDS
Edit
- Declaration:
- Exactly one
- Case:
- Default case:
If all else fails
<punctuation>
- Up to one
- Selected when no other case is selected
- Can be followed by any runnable code.
- Ending:
That's what I did
<punctuation>
- Exactly one
Examples
Edit
-
In regards to
Pinkie’s Tail
:
On the
1
st hoof
.
.
.
I said
“That’s impossible!”
.
On the
2
nd hoof
.
.
.
I said
“There must be a scientific explanation”
.
On the
3
rd hoof
.
.
.
I said
“There must be an explanation”
.
On the
4
th hoof
.
.
.
I said
“Why does this happen?!”
.
I would
flail
.
If all else fails
.
.
.
I said
“She’s just being Pinkie Pie.”
.
That’s what I did
.
In regards to
being silly
:
That's what I did
.
- A switch does not need a body. This line would only be written for human-readability and should not be compiled.
Did you know that
the best Princess
is
number
1
?
Did you know that
Luna
always is
number
1
?
Did you know that
Celestia
always is
number
2
?
In regards to
the best Princess
:
On the
Luna
hoof
.
.
.
I said
“That’s right!”
.
On the
Celestia
hoof
.
.
.
I said
“Something's wrong, here...”
.
That's what I did
.
See Also
Edit