Skip to content

Add IsPrimeNumber usage example for SplashKit utilities#673

Open
Mdanial01 wants to merge 1 commit intothoth-tech:usage-examplesfrom
Mdanial01:mdanial_isprime
Open

Add IsPrimeNumber usage example for SplashKit utilities#673
Mdanial01 wants to merge 1 commit intothoth-tech:usage-examplesfrom
Mdanial01:mdanial_isprime

Conversation

@Mdanial01
Copy link

Description

This PR adds a new SplashKit utility usage example demonstrating how to test integers for primality
using the built-in is_prime_number (Python/C++) and IsPrimeNumber (C#) functions.
It includes multi-language examples for Python, C++, and C# (both OOP and top-level).
The example is minimal, clear, and demonstrates the function in the least number of lines possible.

Usefulness: A SplashKit user may want to check if a number is prime for math-based games,
algorithms, or educational purposes. This example clearly shows the difference between prime
and non-prime numbers.

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • Verified output in Python using SplashKit
  • Verified output in C++ using SplashKit
  • Verified output in C# (OOP and top-level) using SplashKit

Testing Checklist

  • 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

Folders and Files Added/Modified

  • Added:
    • public/usage-examples/utilities/is_prime-1-example.py
    • public/usage-examples/utilities/is_prime-1-example.cpp
    • public/usage-examples/utilities/is_prime-1-example-oop.cs
    • public/usage-examples/utilities/is_prime-1-example-top-level.cs
    • public/usage-examples/utilities/is_prime-1-example.txt

Additional Notes

This example demonstrates the use of SplashKit’s is_prime_number / IsPrimeNumber functions across
multiple languages, providing a consistent, minimal, and easy-to-follow example for developers.
is_prime

@netlify
Copy link

netlify bot commented Oct 13, 2025

Deploy Preview for splashkit ready!

Name Link
🔨 Latest commit febdcd3
🔍 Latest deploy log https://app.netlify.com/projects/splashkit/deploys/68ec53b4d15e4e0008ef02ec
😎 Deploy Preview https://deploy-preview-673--splashkit.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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.

1 participant