You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added an exercise that displays a randomly selected whole number from 1 through 10, inclusive. The value can vary each time the exercise runs, and the displayed result always falls within that range. This gives users a simple, visible example of a randomly generated number in the program’s output.
No actionable comments were generated in the recent review.
Walkthrough
The change adds func_random, which returns a uniformly distributed integer from 1 through 10. The main function seeds an mt19937 generator, prints the result, and returns EXIT_SUCCESS.
Changes: Random number generation
Layer / File(s)
Summary
Generate and print a random integer exercises/random_number.cpp
func_random generates an integer from 1 through 10 using the supplied generator. main seeds the generator with random_device, prints the result, and returns EXIT_SUCCESS.
This adds a small standalone program that prints a random integer from 1 through 10. No actionable merge risk was identified.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title "feat: implement random_number exercise" matches the changeset. The PR adds exercises/random_number.cpp, a program that seeds an mt19937 generator, draws a uniform integer from 1 to 10, prin…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title "feat: implement random_number exercise" matches the changeset. The PR adds exercises/random_number.cpp, a program that seeds an mt19937 generator, draws a uniform integer from 1 to 10, prints it, and returns EXIT_SUCCESS. The title names the main change and the file's purpose. It uses a conventional commit prefix and is short, specific, and clear.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: defaults
Review profile: CHILL
Plan: Advanced
Run ID: 1c97c8d3-aff3-4bc5-a150-249b0920bf38
Commits
Reviewing files that changed from the base of the PR and between dfd2a08 and ca1541b.
Files selected for processing: 1
exercises/random_number.cpp
Files with no reviewable changes: 1
exercises/random_number.cpp
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
andreafazzina
changed the title
feet: implement random_number exercise
feat: implement random_number exercise
Nov 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by CodeRabbit