Jump to content

Constrained random points on a circle: Difference between revisions

added RPL
m (→‎{{header|Sidef}}: updated code)
(added RPL)
Line 3,653:
 
[[File:CalmoSoftDrawCircle.jpg]]
 
=={{header|RPL}}==
{{works with|HP|48G}}
[[File:Constrained|thumb|alt=Screenshot of a HP-48G emulator, displaying constrained random points on a circle|HP-48G emulator screenshot]]
« ERASE -15 15 DUP2 XRNG YRNG <span style="color:grey">@ set graphics boundaries</span>
DEG -19 SF 0 <span style="color:grey">@ set degrees mode, polar vector mode, count = 0</span>
'''DO''' RAND 5 * 10 + RAND 360 * →V2 <span style="color:grey">@ z = rand(10..15).exp(i.rand(360))</span>
C→R IP SWAP IP R→C <span style="color:grey">@ make z a complex with integer coordinates</span>
'''IF''' DUP ABS DUP 10 ≥ SWAP 15 ≤ AND <span style="color:grey">@ if 10 ≤ | z | ≤ 15</span>
'''THEN''' PIXON 1 + <span style="color:grey">@ then set pixel and increment count</span>
'''ELSE''' DROP '''END'''
'''UNTIL''' DUP 100 ≥ '''END'''
DROP { } PVIEW
-19 CF
» '<span style="color:blue">TASK</span>' STO
 
=={{header|Ruby}}==
1,151

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.