Age | Commit message (Collapse) | Author | |
---|---|---|---|
2024-07-26 | Clean up count drawing logic a bit, add iterations to the count text | Aryadev Chavali | |
2024-07-26 | Added counter to draw loop to show the amount of nodes computed | Aryadev Chavali | |
2024-07-26 | Functioning main loop which draws number lines and iterations | Aryadev Chavali | |
Pretty cool! | |||
2024-07-26 | Function to draw the complete number line | Aryadev Chavali | |
Draws a guide line, computes bounds (which we should defer), draws all nodes in the tree then draws the bounds. | |||
2024-07-26 | Make draw_node_number_line non recursive | Aryadev Chavali | |
Using a stack or queue, we can replace a function recursive tree traversal with a single call. A stack would make it a DFS while a queue would be a BFS. Since there's only ever two children, and at high iteration counts we're getting quite large depth, it would be best to do a DFS, hence the stack. | |||
2024-07-26 | recursive function to draw tree in a number line | Aryadev Chavali | |
Draws the current node by converting its norm value (which is in (lower, upper)) to a screen value, drawing a line there. It then recurs on the children of the node. | |||
2024-07-26 | Helper to draw a fraction as text at point (x, y) | Aryadev Chavali | |
2024-07-26 | Helper to convert a value in (min, max) to an equivalent in (0, width) | Aryadev Chavali | |
2024-07-26 | Helpers to get the rightmost and leftmost node | Aryadev Chavali | |
This, due to the properties of a cw tree, will be the largest and smallest fraction of the tree. | |||
2024-07-26 | Define some constants and include a ton of stuff | Aryadev Chavali | |
2024-07-26 | Make window in Raylib | Aryadev Chavali | |
2024-07-26 | Change main to use new numerics module. | Aryadev Chavali | |
2024-07-26 | A simple test, iterating 10 times and printing out the generated tree | Aryadev Chavali | |
Seems to work! | |||
2024-07-26 | Fix up indenting and empty children in to_string for node | Aryadev Chavali | |
2024-07-26 | Added to_string for Nodes | Aryadev Chavali | |
Recursive implementation with proper indenting! | |||
2024-07-26 | Added to_string for fractions | Aryadev Chavali | |
2024-07-26 | Rework binary tree to use indexes in nodes vector | Aryadev Chavali | |
An index is a pointer, and they don't change if the vector decides to reallocate internally unlike the bastardised pointers I was rolling up before. This simplifies design a bit. | |||
2024-07-26 | Added helper method to allocate nodes from the vector for me | Aryadev Chavali | |
The vector acts as an arena for the nodes to be allocated from, better and faster than allocating each child on the heap individually. | |||
2024-07-26 | Queue based iteration procedure | Aryadev Chavali | |
Pops an item off the queue and generate left and right children for it, if those are empty. Then push those children into the queue for the next iteration. NOTE: Because we're using a queue, this does a breadth first generation of the tree, which is what we want. | |||
2024-07-26 | Binary tree of fractions | Aryadev Chavali | |
Will be used in creating the cw tree. | |||
2024-07-26 | Simplify at constructor in Fraction | Aryadev Chavali | |
Let's just deal with simplified stuff anyway? | |||
2024-07-26 | Added comparators to Fraction struct | Aryadev Chavali | |
2024-07-26 | Extracted gcd algorithm into its own function | Aryadev Chavali | |
2024-07-26 | Simple fraction structure | Aryadev Chavali | |
Holds numerator and denominator. Can self simplify, but not automatically. | |||
2024-07-26 | Hello, world! | Aryadev Chavali | |