Usage example of greatest common divisor#667
Usage example of greatest common divisor#667dhruvjanghu wants to merge 2 commits intothoth-tech:mainfrom
Conversation
…n in all languages
✅ Deploy Preview for splashkit ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Mdanial01
left a comment
There was a problem hiding this comment.
The commit has code from other PR as well. Check the following link to get an idea about branching in Git:
https://git-scm.com/book/en/v2/Git-Branching-Branches-in-a-Nutshell
222448082Ashen
left a comment
There was a problem hiding this comment.
Description
This PR adds four new usage example files demonstrating the use of the greatest_common_divisor (GCD) function in C++, Python, and C# (Top-level and OOP styles).
These examples show:
- Correct implementation of the Euclidean algorithm
- Consistent output and behavior across all languages
- Clear beginner-friendly variable names and UI text
There are no external dependencies required for this change.
Type of change
- Bug fix
- New feature
- Breaking change
- Documentation
How Has This Been Tested?
The code was reviewed manually to verify:
- Correct GCD logic in all 4 files
- Correct SplashKit usage
- Same output and behavior across all languages
- Proper window setup and exit handling
Test method:
-
Manual code review
-
Logic matched expected GCD results
-
UI output verified by inspection
-
Tested in latest Chrome
-
Tested in latest Firefox
-
npm run build
-
npm run preview
Checklist
If involving code
- My code follows the style guidelines of this project
- I have performed a self-review of my own code
- I have commented my code in hard-to-understand areas
- I have made corresponding changes to the documentation
- My changes generate no new warnings
If modified config files
- package.json
- astro.config.mjs
- netlify.toml
- docker-compose.yml
- custom.css
Folders and Files Added/Modified
-
Added:
- public/usage-examples/utilities/gcd_1_example.cpp
- public/usage-examples/utilities/gcd_1_example.py
- public/usage-examples/utilities/gcd_1_example-top-level.cs
- public/usage-examples/utilities/gcd_1_example-oop.cs
-
Modified:
- None
Additional Notes
- All four files follow the same logic and visual output.
- The examples are consistent and suitable for beginners.
- The implementation is clean and efficient.
- This PR was reviewed and approved.
Description
Added a new usage example demonstrating the
greatest_common_divisorfunction in SplashKit.includes version in 4 different languages.
No additional dependencies are required for this change.
Type of change
How Has This Been Tested?
All language versions were tested locally using MSYS2 and SplashKit libraries.
Each file was compiled and executed successfully, producing the expected visual output:
No warnings or build errors occurred.
Testing Checklist
Folders and Files Added/Modified
public/usage-examples/utilities/gcd_1_example.cpppublic/usage-examples/utilities/gcd_1_example-oop.cspublic/usage-examples/utilities/gcd_1_example-top-level.cspublic/usage-examples/utilities/gcd_1_example.pypublic/usage-examples/utilities/gcd_1_example.txtpublic/usage-examples/utilities/gcd_1_example.png