Skip to content
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

Merged
merged 6 commits into from
Jan 30, 2025

Conversation

CodeR-na-r1
Copy link
Contributor

No description provided.

// Компонент для генерации псевдо-случайного числа. Seed задается при помощи отсчета времени
class Random {

stateRandom state{1, 2, 3, 4};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seed задаётся на каждом вызове random?
Казалось, что seed устанавливается один раз при запуске программы. Нужна мотивировка.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

При каждой генерации числа задействуется функция millis, получается в данной реализации нет seed-а. Но можно добавить seed в реализацию (будет инициализироваться в конструкторе).

Copy link
Contributor Author

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",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

См. комментарии в lapki-client#653

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@L140-beep L140-beep merged commit 4827401 into kruzhok-team:master Jan 30, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants