MatheusRich / MatheusRich/rich_engine
Helpers
Open
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 1
- Forks
- 0
- Avg merge
- 9d 1h
- Merged PRs (30d)
- 1
Description
- Weighted sample
class Hash
def wsample
max_by { |_, w|
next -Float::INFINITY if w == 0
rand**(1.0 / w)
}&.first # first to return just the key
end
def wsample_strict
total_probability = values.sum
raise ArgumentError, "Weights must add up to 1, but they add up to #{total_probability}." if total_probability != 1
wsample
end
end
- bresenham's line
- @canvas.draw_line/draw_rect_outline
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files or tests are named. Start by locating the code behind @canvas.draw_line and @canvas.draw_rect_outline and inspecting how helpers are organized; done means the weighted sampling helpers, Bresenham line, and requested canvas drawing helpers are implemented and covered by the project's existing checks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- game-dev
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100