Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/matsumotory/mruby-random
mruby-random
https://github.com/matsumotory/mruby-random
Last synced: about 2 months ago
JSON representation
mruby-random
- Host: GitHub
- URL: https://github.com/matsumotory/mruby-random
- Owner: matsumotory
- Created: 2012-12-28T13:08:04.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2013-07-27T09:49:23.000Z (over 11 years ago)
- Last Synced: 2024-10-18T18:23:41.622Z (3 months ago)
- Language: C
- Size: 107 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# This mrbgem was included in mruby/mruby
This mrbgem is random class sample.
# Random Module for mruby
mruby random module with Mersenne Twister.base code are mt19937ar.sep.tgz and iij/mruby
## install by mrbgems
- add conf.gem line to `build_config.rb`
```ruby
MRuby::Build.new do |conf|# ... (snip) ...
conf.gem :git => 'https://github.com/matsumoto-r/mruby-random.git'
end
```## example
```ruby
Random::srand(10)
hoge = Random::rand()
Random::srand(20)
fuga = Random::rand()
Random::srand(10)
foo = Random::rand()puts hoge == fuga
puts hoge == foo3.times do |i|
puts Random::rand()
puts Random::rand(0)
puts Random::rand(10)
puts Random::rand(50)
puts Random::rand(100)
end
```# License
under the MIT License:* http://www.opensource.org/licenses/mit-license.php