xhroot

Rangecheck

According to Oracle, Java’s rangeCheck is a formidable accomplishment. Here it is in LOLCODE:

Example usage:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
I HAS A RESULT

BTW expected output -> `ILLEGAL ARGUMENT: FROMINDEX(5) > TOINDEX(4)`
RESULT R RANGECHECK 10 5 4
RESULT, O RLY?
  YA RLY, VISIBLE RESULT, OIC

BTW expected output -> `INDEX OUT OF RANGE: -1`
RESULT R RANGECHECK 10 -1 4
RESULT, O RLY?
  YA RLY, VISIBLE RESULT, OIC

BTW expected output -> `INDEX OUT OF RANGE: 40`
RESULT R RANGECHECK 10 5 40
RESULT, O RLY?
  YA RLY, VISIBLE RESULT, OIC

BTW expected output -> none
RESULT R RANGECHECK 10 4 9
RESULT, O RLY?
  YA RLY, VISIBLE RESULT, OIC

Comments