Pastebin
API
tools
faq
paste
Login
Sign up
SHARE
TWEET
yield example
saasbook
Jan 23rd, 2012
5,689
0
Never
Add comment
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!
Ruby
0.18 KB
| None
|
0
0
raw
download
clone
embed
print
report
class
RandomSequence
def
initialize
(
limit,num
)
@limit
,@num = limit,num
end
def
each
@num
.
times
{
yield
(
rand
*
@limit
)
.
floor
}
end
end
n = RandomSequence.
new
(
10
,
4
)
Advertisement
Add Comment
Please,
Sign In
to add comment
Public Pastes
+45,600$ in 3 days
CSS | 3 min ago | 0.91 KB
Untitled
6 min ago | 7.19 KB
+218,600$ in 3 days
CSS | 6 min ago | 0.94 KB
Free Crypto Method
CSS | 7 min ago | 0.94 KB
Free Crypto Method
CSS | 11 min ago | 0.91 KB
2026 AI MONEY MACHINE
CSS | 18 min ago | 0.91 KB
FREE BTC STRATEGY
CSS | 26 min ago | 0.91 KB
Free Crypto Method
CSS | 29 min ago | 0.94 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!