Data-ChipsChallenge

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN

that's an indicator that this Perl module won't either).

## compress\_map (grid MAP\_DATA)

Given the 2D grid `MAP_DATA`, the map is compressed and returned in raw binary.

## decode\_password (bin RAW\_BINARY)

Given the encoded level password in raw binary (4 bytes followed by a null byte),
this function returns the 4 ASCII byte password in clear text. This is the password
you'd type into Chip's Challenge.

Passwords are decoded by XORing the values in the raw binary by hex `0x99`,
if you're curious.

## encode\_password (string PASSWORD)

Given the plain text password `PASSWORD`, it encodes it and returns it as
a 5 byte binary string (including the trailing null byte).

## random\_password

Returns a random 4-letter password.

# REFERENCE

The following is some reference material relating to certain in-game data
structures.

## Option Fields Max Length

If the "Option Fields" are more than 1152 bytes altogether, Chip's Challenge
will crash when loading the level. The "Option Fields" include the following:

    Map Title
    Bear Trap Controls
    Cloning Machine Controls
    Map Password
    Map Hint
    Movement

Bear Trap Controls use 10 bytes for every link. Cloning Machine Controls use
8 bytes for every link. Map passwords use 7 bytes. Movement data uses 2 bytes
per entry.

In addition, bear traps, clone machines, and movement data use 2 bytes in
their headers.

## Object Hex Codes

The two map layers on each level are 2D arrays of uppercase hexadecimal codes. Each of
these codes corresponds to a certain object that is placed at that location in the map.
This table outlines what each of these hex codes translates to, object-wise:

    00 Empty Tile (Space)
    01 Wall
    02 Computer Chip
    03 Water
    04 Fire
    05 Invisible Wall (won't appear)
    06 Blocked North
    07 Blocked West
    08 Blocked South
    09 Blocked East
    0A Movable Dirt Block
    0B Dirt (mud, turns to floor)
    0C Ice
    0D Force South (S)
    0E Cloning Block North (N)
    0F Cloning Block West (W)
    10 Cloning Block South (S)
    11 Cloning Block East (E)
    12 Force North (N)
    13 Force East (E)
    14 Force West (W)
    15 Exit
    16 Blue Door
    17 Red Door
    18 Green Door
    19 Yellow Door
    1A South/East Ice Slide
    1B South/West Ice Slide
    1C North/West Ice Slide
    1D North/East Ice Slide
    1E Blue Block (becomes Tile)
    1F Blue Block (becomes Wall)
    20 NOT USED
    21 Thief
    22 Chip Socket
    23 Green Button - Switch Blocks
    24 Red Button   - Cloning
    25 Switch Block - Closed
    26 Switch Block - Open
    27 Brown Button - Bear Traps
    28 Blue Button  - Tanks
    29 Teleport
    2A Bomb
    2B Bear Trap
    2C Invisible Wall (will appear)
    2D Gravel
    2E Pass Once
    2F Hint
    30 Blocked South/East
    31 Cloning Machine
    32 Force Random Direction
    34 Burned Chip
    35 Burned Chip (2)
    36 NOT USED
    37 NOT USED
    38 NOT USED
    39 Chip in Exit - End Game
    3A Exit - End Game
    3B Exit - End Game
    3C Chip Swimming (N)
    3D Chip Swimming (W)
    3E Chip Swimming (S)
    3F Chip Swimming (E)
    40 Bug (N)
    41 Bug (W)
    42 Bug (S)
    43 Bug (E)
    44 Firebug (N)
    45 Firebug (W)
    46 Firebug (S)
    47 Firebug (E)
    48 Pink Ball (N)
    49 Pink Ball (W)
    4A Pink Ball (S)
    4B Pink Ball (E)
    4C Tank (N)
    4D Tank (W)
    4E Tank (S)
    4F Tank (E)
    50 Ghost (N)
    51 Ghost (W)
    52 Ghost (S)
    53 Ghost (E)
    54 Frog (N)
    55 Frog (W)
    56 Frog (S)
    57 Frog (E)
    58 Dumbbell (N)
    59 Dumbbell (W)
    5A Dumbbell (S)
    5B Dumbbell (E)
    5C Blob (N)
    5D Blob (W)
    5E Blob (S)
    5F Blob (E)
    60 Centipede (N)
    61 Centipede (W)
    62 Centipede (S)
    63 Centipede (E)
    64 Blue Key
    65 Red Key
    66 Green Key
    67 Yellow Key
    68 Flippers
    69 Fire Boots
    6A Ice Skates
    6B Suction Boots
    6C Chip (N)
    6D Chip (W)



( run in 0.520 second using v1.01-cache-2.11-cpan-99c4e6809bf )