Code
Treasure Map
Treasure Chest
Help
 1 2 3 4 5 6 7 8 9 10 11 12
```x = "A"
y = "B"
z = x
i = 15
j = 2 * i / 10
column = z
row = j
OUTPUT column + row
```
```code = "treasure"
code[0] = "T"
column = code[2]
row = LENGTH(code)
row = row - 2
OUTPUT column + row```
```longitude = 39
lattitude = 45
IF lattitude < longitude THEN
row = longitude - lattitude
column = "C"
ELSE
row = lattitude - longitude
column = "K"
END IF
OUTPUT column + row
```
```row = 1
FOR i FROM 1 TO 4
row = row + 2
NEXT i
message = "Pirates of the Carribean"
column = message[row]
OUTPUT column + row
```
```row = 3
message = "Atlantic Ocean"
FOR i FROM 1 TO 4
row = row + i
NEXT i
row = row DIV 2
column = message[3]
OUTPUT column + row```
```FUNCTION square(number)
RETURN number * number
END FUNCTION

row = square(3)
column = LEFT("Blackbeard",1)
OUTPUT column + row```
```position = "Long. 37.4, lat. 112.9"
longitude = LEFT(position,10)
lattitude = RIGHT(position,10)
row = RIGHT(longitude,1)
IF LENGTH(position) > 10 THEN
column = "J"
ELSE
column = "G"
END IF
OUTPUT column + row```
```code = "Pacific Ocean"
row = 0
WHILE code[row] != "f"
row = row + 1
WHILE END
column = RIGHT(code,1)
OUTPUT column + row```
```column = CHR("75")
row = ASCII("A")
IF column=="K" THEN
row = row - 60
ELSE
row = row + 60
END IF
OUTPUT column + row```
```letters = ["G", "K", "C", "E", "J", "D"]
column = letters[0]
FOR i FROM 0 TO 5
IF letters[i] < column THEN
column = letters[i]
row = i
END IF
NEXT i
OUTPUT column + row
```
```row = 10
FOR i FROM 0 TO 10 STEP 2
row = row + 10
NEXT i
column = ASCII(row)
row = row / 10
OUTPUT column + row```
```high = 14
low = 8
WHILE high > low
low = low + 1
high = high -1
END WHILE
row = high MOD 2
column = RIGHT(LEFT("pirate",4),1)
OUTPUT column + row
```

Golden Coins

A Dark Red Ruby

A Sparkly Diamond

A rare Crystal

A Golden Compass

A Treasure Map

Blackbeard's Sword

A Golden Ring

A Barrel of Rum

A Message in a Bottle

Blackbeard's Flag
```String Manipulation
string = "abcdef"
string[0] would return "a", the character in the string at position 0
string[1] would return "b", the character in the string at position 1
string[2] would return "c", the character in the string at position 2
etc.
LENGTH(string) would return the number of characters in the string (e.g. 6)
LEFT(string,3) would return the first 3 characters of the string (e.g. "abc")
RIGHT(string,3) would return the last 3 characters of the string (e.g. "def")

MOD & DIV
DIV is the quotient of a division, whereas MOD is the remainder.
For instance: 20 / 3 = 6 remainder 2
So:
20 DIV 3 would return 6
20 MOD 3 would return 2

ASCII Codes
Check the following ASCII table to lookup the right codes.
```