Skip to main content

Shuffle

Simple Shuffle

This example uses the nada-numpy shuffle implementation to shuffle an array of four secret integers and return the shuffled values. This process preserves the original elements but places them in a different order.

src/shuffle_simple.py
loading...

Run and test the shuffle_simple program

1. Open "Nada by Example"

Open in Gitpod

2. Run the program with inputs from the test file

nada run shuffle_simple_test

3. Test the program with inputs from the test file against the expected_outputs from the test file

nada test shuffle_simple_test

More Shuffle Examples

This example demonstrates how the nada-numpy shuffling operation supports multiple data types, including Rational, SecretRational, PublicInteger, and SecretInteger. Shuffling can be applied using two approaches: the shuffle() function or the built-in .shuffle() method on arrays.

src/shuffle.py
loading...

Run and test the shuffle program

1. Open "Nada by Example"

Open in Gitpod

2. Run the program with inputs from the test file

nada run shuffle_test

3. Test the program with inputs from the test file against the expected_outputs from the test file

nada test shuffle_test