mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-09-12 01:24:17 +00:00
urandom: Move example to Move Hub.
Move it do a dedicated example instead of hardcoding it in the module docstring. Also update changelog for missing previous changes while we are at it.
This commit is contained in:
@@ -8,18 +8,6 @@
|
||||
|
||||
"""
|
||||
This module implements pseudo-random number generators.
|
||||
|
||||
.. note:: This module is not available on the BOOST Move Hub.
|
||||
|
||||
You can make your own random number generator like this instead::
|
||||
|
||||
_rand = hub.battery.voltage() + hub.battery.current() # seed
|
||||
|
||||
# Return a random integer N such that a <= N <= b.
|
||||
def randint(a, b):
|
||||
global _rand
|
||||
_rand = 75 * _rand % 65537 # Lehmer
|
||||
return _rand * (b - a + 1) // 65537 + a
|
||||
"""
|
||||
|
||||
from typing import Any, Optional, Sequence, overload
|
||||
|
||||
Reference in New Issue
Block a user