-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Компонент "рандом" для плат Arduino #101
Conversation
// Компонент для генерации псевдо-случайного числа. Seed задается при помощи отсчета времени | ||
class Random { | ||
|
||
stateRandom state{1, 2, 3, 4}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seed задаётся на каждом вызове random?
Казалось, что seed устанавливается один раз при запуске программы. Нужна мотивировка.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
При каждой генерации числа задействуется функция millis, получается в данной реализации нет seed-а. Но можно добавить seed в реализацию (будет инициализироваться в конструкторе).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seed задаётся на каждом вызове random? Казалось, что seed устанавливается один раз при запуске программы. Нужна мотивировка.
Сделал как обсудили на планерке
|
||
"Random": { | ||
"description": "Генерация псевдо-случайного числа", | ||
"img": "arduino/timer.svg", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
См. комментарии в lapki-client#653
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
No description provided.