FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Monte carlo crystal by henrikac · Pull Request #893 · algorithm-archivists/algorithm-archive · GitHub

Monte carlo crystal - #893

Open
henrikac wants to merge 2 commits into
algorithm-archivists:mainfrom
henrikac:monte-carlo-crystal
Open

Monte carlo crystal#893
henrikac wants to merge 2 commits into
algorithm-archivists:mainfrom
henrikac:monte-carlo-crystal

Conversation

Copy link
Copy Markdown
Contributor

This PR adds the Monte Carlo methods in Crystal.

Copy link
Copy Markdown
Contributor Author

[lang: crystal]

Amaras added Implementation This provides an implementation for an algorithm. (Code and maybe md files are edited.) hacktoberfest-accepted labels Oct 21, 2021

Copy link
Copy Markdown

Perhaps more idiomatic way to count points inside the circle would be

pi_count = n.times.count do
  in_circle(rand, rand)
end

but other than that the code looks good to me.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hacktoberfest-accepted Implementation This provides an implementation for an algorithm. (Code and maybe md files are edited.) lang: crystal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL