User Tools

Site Tools


notes:data:fall2023:projects:ttb1

This is an old revision of the document!


TTB1

NODE STRUCT

What is a node struct? A node struct is used to represent an element, in our case, a brick, within a list.

An example of a structure for a node is as follows:

struct BrickNode
{
    bool Active;
    int X, Y;          // Position on screen
    int Width, Height; // Size of hitbox for brick
    BrickNode* next;   // Pointer to the next brick node
};

NODE POINTER

MALLOC A NODE

LINKING NODES TOGETHER

TRAVERSING LIST

INSERTING NODE INTO LIST

AT START OF LIST

IN THE MIDDLE OF THE LIST

APPENDING NODE INTO LIST

AT END OF LIST

IN THE MIDDLE OF THE LIST

REMOVING A NODE FROM THE LIST

AT THE START OF LIST

IN THE MIDDLE OF THE LIST

AT END OF LIST

notes/data/fall2023/projects/ttb1.1694806330.txt.gz · Last modified: 2023/09/15 19:32 by wgates1