Sylladex

The Sylladex is the inventory system in Homestuck. Most player-controlled characters have a Sylladex to store and retrieve artifacts from, which consists of two decks of cards: the Captchalogue Deck and the Strife Deck. These cards have codes on their backs that can be entered on the Punch Designix to create a punched card. The Wayward Vagabond does not possess a sylladex and simply carries objects in his hands; the Peregrine Mendicant so far appears to lack one as well. The Midnight Crew members can each hold 5 weapons and one item, which is in all cases a Deck of Cards/Storage Item.

Captchalogue Deck
The Captchalogue Deck is where artifacts are stored to be used later. Artifacts are stored on Captchalogue Cards, and while stored, they have no physical size or weight (so while John Egbert is unable to actually use a Sledgehammer on his own, he is still able to carry it around in his Sylladex), making the Sylladex much like a magic satchel. However, there is a limit to how many different items can be captchalogued, based on the number of cards in the character's deck. Captchalogue cards can be added to the Captchalogue Deck by captchaloguing them and then forcing them out of the deck.

Fetch Modi
The fashions in which artifacts are stored to and retrieved from the Sylladex depend on the currently active Fetch Modus. The active Fetch Modus can be chosen as long as the Sylladex has the card with the desired Fetch Modus. Each Fetch Modus has a unique color given to all Captchalogue cards in a Sylladex that uses it. When outside of a Sylladex, Captchalogue cards are red.

Stack
John's first Sylladex Fetch Modus, signified by a bright magenta Sylladex and matching Captchalogue cards. Captchalogue cards are arranged in a stack, and the player can only use or otherwise interact with the one at the top of the stack. The top card may also be combined with the previous card if doing so is logical (or if the objects can be physically forced into one another), or use it with the previous card. If an object is picked up while the Sylladex is full, the item at the bottom of the stack will be dropped.

Even though his Sylladex is set to Stack by default, John finds his Stack Fetch Modus card under his Magic Chest after Rose moves it using Sburb. This is likely because he had used it already and then lost it.

This fetch modus is based on the stack data structure.

Queue
The second Fetch Modus John obtains, signified by an orange Sylladex and matching Captchalogue cards. It is essentially the opposite of the Stack, in that only the card at the bottom of the deck (the one that was added before any of the others) may be used directly. It also propels the items that are pushed out of the deck faster (making it a valuable Fetch Modus for weaponizing one's Sylladex). Otherwise, it behaves identically to the Stack.

John finds the Queue Fetch Modus card in a copy of Data Structures for Assholes.

Though John had a separate card for his Stack and Queue Modi, they were identical cards with different settings, since John could switch either card to fulfill either Modus. He later combined the two with the Modus Control Deck, thus allowing him to draw cards from either side of his "Queuestack" without the inconvenience of having to switch his Modus type back and forth.

This fetch modus is based on the queue data structure.

Array
The third Fetch Modus John obtains, originally intended as a birthday present from Dad. It is a lighter blue in color. It supposedly allows John to fetch any card at will, though presumably he must memorize the placement of a given item (as compared to Dave's Hash Map, which assigns a name to each card). John considers this to be excessively boring, however, and uses the Modus Control Deck he obtained from Dad's Room to combine it with his Queuestack, thus creating an Array of four 6-card Queuestacks.

This fetch modus is based on the array data structure.

Tree
Rose Lalonde's Fetch Modus, signified by a lime green Sylladex and matching Captchalogue cards. She admits that it isn't exactly practical but initially considers it elegant. The first item is captchalogued in the Root Card. Any more items that are picked up are Branches attached to an existing card and, like the root itself, may have up to two branches of their own (making this a binary tree). Branches with no further branches of their own are called Leaf Cards. Cards are sorted alphabetically: they join the left branch of an existing card if they come alphabetically before that card, or the right branch otherwise. Nothing has been shown to demonstrate what happens if she has two identical objects. The only cards Rose may access are the root or leaf cards; intermediate branches can only be accessed by moving them to the root or leaf positions via the optional auto-balancing feature, which (like an AVL tree) rearranges the tree whenever it becomes too unbalanced. If she uses the Root Card, all of the items below will fall out of the sylladex, which is why she has set it to Leaf instead of Root.

Rose's Fetch Modus does not seem to have a way to force an item out of her deck, by the Modus' nature. This is significantly different from others shown thus far. Firstly, it means that her deck is probably not conveniently weaponizable, though it could potentially drop a large number of items on anyone below her. More importantly, however, this also implies that she cannot force a Captchalogue card out of her deck to increase her Captchalogue Deck's size. This may be because she may not have a card limit, as she always seems to be able to create another branch whenever she obtains another item and has never yet been shown with an empty card as every other Sylladex user has.

This fetch modus is based on the binary tree data structure.

Hash Map
Dave Strider's Fetch Modus, signified by a yellow Sylladex and matching Captchalogue cards. Hash maps work through a key-to-value lookup structure, making the Hash Map Fetch Modus the most like a traditional inventory. Each card in the deck is given an index from zero to the number of cards in the deck minus 1 (10 cards leaves an index range of 0 to 9). When an item is captchalogued into a Hash Map Sylladex, where it is placed into the card stack depending on the current Hash Function. If an object already occupies the card with the produced index, the item in the card is ejected from the Sylladex to make room for the new item. In order to retrieve an item from the stack, the character must perform an action related to the item with a keyword that will produce the same index as the card that holds the desired item. Items apparently are retrieved so long as a relevant command with an equivalent hash is uttered, regardless of Dave's actual desire to use the item. If the objects are retrieved this way, then they're thrown out as if another item was placed in their card. The force of which the item ejects from the Sylladex may be related to how much emphasis is used on the command.

On the back of the fetch modus card are several options. One of them, a "potentially dangerous button," ejects every item in the Sylladex. Another option allows the user to change the hash function used to calculate indexes, though changing the hash function will eject all items too. A final option is a check box labelled 'detect collisions' which originally was unchecked. Now that it's checked, Dave is prevented from captchaloging an item when doing so will cause another item to be displaced and ejected, making captchaloging slower but safer.

It is notable that objects that are captchalogued don't have a set name. For example, Dave captchalogued multiple Shuriken (3) one at a time to avoid dislodging a Box (5) he had filled with Fireworks (5). This is after he spilled the Box of Fireworks (3) by replacing it with Nunchaku (3). Items that share the same index can be combined even if the combined name of the items wouldn't equal that index.

This fetch modus is based on the hash map data structure.

Hash Functions

 * The hash function Dave uses most often gives each letter in the word of an item's name a value (2 for consonants and 1 for vowels), adds the numbers up, and divides the sum by the number of Captchalogue Cards in the deck. The index is the remainder. The letter "Y" can be used as either a consonant or a vowel, but only a hashmap noob would use such a cheap trick.
 * Another hash function switches the values, making vowels worth 2 and consonants worth 1.
 * A third function gives letters their value based on the order they appear in the alphabet. (A=1, B=2, C=3, and so on)
 * Dave programs a fourth function in which each letter's value is the same as the letter would have in a game of Scrabble. Specifically, A=1, B=3, C=3, D=2, E=1, F=4, G=2, H=4, I=1, J=8, K=5, L=1, M=3, N=1, O=1, P=3, Q=10, R=1, S=1, T=1, U=1, V=4, W=4, X=8, Y=4, and Z=10.

Jade's Modus Set
Jade Harley has a whopping twelve Fetch Modi, which comprise the Modus Set that her Grandfather bought her for Christmas. All twelve of these Modi are based upon popular board games. Judging by the official product logos and trademark symbols, it is highly likely that these Modi can only be obtained via purchase.

The fact that these Modi are based upon board games rather than data structure is consistent with Jade's silly, playful nature and her apparent lack of interest in serious computing.

Jade also has a large amount of Captchalogue cards. She has 52 cards (the number of cards in a standard playing card deck), and when she has no Fetch Modus selected, they are arranged into thirteen stacks of four.

Memory
Based upon the beloved game of matching pairs of identical cards, this is Jade's preferred Fetch Modus, due to her powers of precognition. This Modus uses an even number of Captchalogue cards, which are purple. When an object is Captchalogued, it is stored in two random cards. In order to access an item, the two cards in which that item is stored must be selected, and it appears that all item positions are randomized when an item is captchalogued. For most people, this would be troublesome to say the least, but for the reason stated above, this Modus is perfectly suited to Jade. Also, her silly, playful nature causes her to flesh out her Sylladex with simple, brightly-colored objects (such as fruit, as we have seen), causing it to more closely resemble a child's card-matching game.

The Rest
The eleven other game-based Fetch Modi have yet to be seen in action. Their names and colors are as follows:

Boggle: Cyan

Pictionary: Mossy green

Monopoly: Pale green

Yahtzee: Burgundy

Clue: Brown

Connect Four: Yellow and blue (this is the only Fetch Modus with a markedly different second color, probably to distinguish it from the also-yellow Hash Map)

Jenga: Dark blue. When an object is Captchalogued, it is stored in three random blocks that comprise a standard Jenga tower. In order to fetch an item, the corresponding bricks must be pulled without toppling the tower over, which will expel all the items stored.

Battleship: Teal

Ouija: Beige

Guess Who: Orange

Operation: Pink

Strife Deck
Items can also be placed into a Strife Deck, which allows the player to use objects to Aggrieve enemies. Each Strife Deck is contained with a Strife Specibus and a character with multiple Strife Specibi will store them within a Strife Portfolio. In order for an artifact to be allocated to a Strife Deck, it must be the same kind of item as the character's chosen Kind Abstratus, and there must be a free Captchalogue Card in the Strife Deck. Strife Decks appear to use special Captchalogue Cards. Each Strife Specibus appears to come with one card in its deck by default.

It should be noted that imps can also place items into their strife deck. They drop their Strife Specibus card when defeated.


 * John's is hammerKind, originally holding both a hammer and a sledgehammer. However, the sledgehammer lost its metal head while he was using it, changing the Specibus' Kind Abstratus into a handleKind and ejecting the other hammer's head. When John repaired the sledgehammer hammerKind restored itself and he lost the rest of the hammer. John also acquired a bunnyKind Specibus and deck from a Shale Imp. There is also an umbrellaKind specibus card in his house, which seems much more useful now that he made the Barber's Best Friend.
 * Rose's is needleKind and holds her knitting needles.
 * Dave's is bladeKind and would hold his first ninja sword, but he accidentally launched it out of his window at a rambunctious crow and now holds a 2nd ninja sword from his wall. Like John's, it suffered from a modification resulting into the second sword being broken in half, and is now ½bladeKind. Whether a way to restore his previous specibus is found or not remains to be seen.
 * Jade's is rifleKind and holds her trusty Hunting Rifle.

Apparently, artifacts allocated to the Strife Deck can be used at will.