- 1, path existence
- 2, shortest path
- 3, number of paths
- 4, shortest path to every other location
- 5, shortest path (a little different)
| local function FindEdges(Object, Directional) | |
| local _CF = Object.CFrame | |
| local Size = Object.Size | |
| local function UpdateCFrame(CF, direction) | |
| local Directions = { | |
| ["Top"] = CF + CF.UpVector * (Size.Y/2), | |
| ["Bottom"] = CF + CF.UpVector * -(Size.Y/2), | |
| ["Left"] = CF + CF.RightVector * -(Size.X/2), | |
| ["Right"] = CF + CF.RightVector * (Size.X/2), |
| type R6Character = Model & { | |
| BodyColors: BodyColors, | |
| Humanoid: Humanoid & { | |
| HumanoidDescription: HumanoidDescription, | |
| Status: Status, | |
| Animator: Animator | |
| }, | |
| Animate: LocalScript & { |
| function find_pivot_positions(matrix) | |
| local m, n = #matrix, #matrix[1] | |
| local pivot_positions = {} | |
| for i = 1, m do | |
| for j = 1, n do | |
| if matrix[i][j] == 1 then | |
| table.insert(pivot_positions, {i, j}) | |
| break | |
| end | |
| end |
| # question can be easily framed into graph pathfinding | |
| # parse inputs | |
| def generated_nexts(current, rules): # has to return rule_id, index and result | |
| for rule_index in range(len(rules)): | |
| a, b = rules[rule_index] | |
| a_length = len(a) | |
| for i in range(len(current) - a_length + 1): # we add one because a is the from | |
| if a == current[i:i + a_length]: # this is a match, we found a position to apply the rule | |
| result = current[:i] + b + current[i + a_length:] | |
| yield rule_index + 1, i + 1, result # very special, but ugly syntax (sorry D:) |
to be done
Some Standard Approaches for Competitive Programming
This RFC proposes the adoption of Backpack instances in place of traditional Folder instances for container organization.
As a roblox game scales, developers continually seek new paradigms for organizing code, modularity, and runtime clarity. Traditional Folder usage, while functional, lacks semantic weight and provides no affordance beyond being a generic instance container.
Backpacks are specialized containers with actual implicit utility. Although they are deisgned to hold tools, it can be recontextualized as a general purpose container for scripts, services and components.
Notably: