Skip to main content

Modulo

src/modulo.py
from nada_dsl import *

def nada_main():
party_alice = Party(name="Alice")
party_bob = Party(name="Bob")
party_charlie = Party(name="Charlie")
dividend = SecretInteger(Input(name="dividend", party=party_alice))
divisor = SecretInteger(Input(name="divisor", party=party_bob))
# modulo
remainder = dividend % divisor
return [Output(remainder, "remainder", party_charlie)]

Run and test the modulo program

1. Open "Nada by Example"

Open in Gitpod

2. Run the program with inputs from the test file

nada run modulo_test

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

nada test modulo_test
Feedback