From a3ad4802724d6d74d333cb5af3ae738c96bf9d80 Mon Sep 17 00:00:00 2001 From: oceans404 Date: Wed, 7 Aug 2024 13:13:16 -0700 Subject: [PATCH] add random number example --- docs/nada-by-example-quickstart.md | 2 +- docs/nada-by-example/random-number.md | 22 ++++++++++++++++++++++ sidebars.js | 3 ++- src/components/TestProgram/index.js | 2 +- 4 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 docs/nada-by-example/random-number.md diff --git a/docs/nada-by-example-quickstart.md b/docs/nada-by-example-quickstart.md index 8d0f8d6..c662ff4 100644 --- a/docs/nada-by-example-quickstart.md +++ b/docs/nada-by-example-quickstart.md @@ -18,7 +18,7 @@ All examples for "Nada by Example" live in the [nada-by-example](https://github. ### 1 Click Setup with Gitpod -[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/oceans404/nada-by-example) +[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/nillionnetwork/nada-by-example) Click the button above to open the Nada by Example repo in Gitpod. Then skip ahead to the [run and test an example](/nada-by-example-quickstart#how-to-run-and-test-an-example-program) section to learn how to run and test a Nada program. diff --git a/docs/nada-by-example/random-number.md b/docs/nada-by-example/random-number.md new file mode 100644 index 0000000..bf09454 --- /dev/null +++ b/docs/nada-by-example/random-number.md @@ -0,0 +1,22 @@ +# Random Number + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import TestProgram from '@site/src/components/TestProgram/index'; + + + + +```python reference showGithubLink +https://github.com/NillionNetwork/nada-by-example/blob/main/src/random_number.py +``` + + + +```yaml reference showGithubLink +https://github.com/NillionNetwork/nada-by-example/blob/main/tests/random_number_test.yaml +``` + + + + \ No newline at end of file diff --git a/sidebars.js b/sidebars.js index 5152c85..5ad997e 100644 --- a/sidebars.js +++ b/sidebars.js @@ -480,12 +480,13 @@ const sidebars = { 'nada-by-example/helper-function', 'nada-by-example/for-loop', 'nada-by-example/reduce', + 'nada-by-example/random-number', 'nada-by-example/voting', 'nada-by-example/r-p-s', { type: 'link', label: 'Request an Example', - href: 'https://github.com/NillionNetwork/nada-by-example/issues/new/choose', + href: 'https://github.com/nillionnetwork/nada-by-example/issues/new/choose', }, { type: 'html', diff --git a/src/components/TestProgram/index.js b/src/components/TestProgram/index.js index f3a08a5..078c9fd 100644 --- a/src/components/TestProgram/index.js +++ b/src/components/TestProgram/index.js @@ -8,7 +8,7 @@ const TestProgram = ({ programName, testFileName }) => {

1. Open "Nada by Example"