Pastebin
API
tools
faq
paste
Login
Sign up
SHARE
TWEET
yield example
saasbook
Jan 23rd, 2012
5,749
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
Documents
18 min ago | 0.43 KB
+12,000$ in 2 days
CSS | 36 min ago | 0.72 KB
Free Crypto Method
CSS | 56 min ago | 0.72 KB
Crypto admin access
57 min ago | 0.43 KB
discord chat view
Python | 4 hours ago | 9.23 KB
systemd-socket-test (AI + Human)
Python | 16 hours ago | 9.34 KB
Puts to sleep and forget
23 hours ago | 0.85 KB
Silk
1 day ago | 3.74 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!