Skip to main content

Power

src/power.py
from nada_dsl import *

def nada_main():
party_alice = Party(name="Alice")
party_bob = Party(name="Bob")
party_charlie = Party(name="Charlie")
base = PublicInteger(Input(name="base", party=party_alice))
exponent = PublicInteger(Input(name="exponent", party=party_bob))
power = base ** exponent
return [Output(power, "power", party_charlie)]

Run and test the power program

1. Open "Nada by Example"

Open in Gitpod

2. Run the program with inputs from the test file

nada run power_test

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

nada test power_test
Feedback