Skip to content

Commit

Permalink
add random number example
Browse files Browse the repository at this point in the history
  • Loading branch information
oceans404 committed Aug 7, 2024
1 parent ec69916 commit a3ad480
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/nada-by-example-quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
22 changes: 22 additions & 0 deletions docs/nada-by-example/random-number.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Random Number

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import TestProgram from '@site/src/components/TestProgram/index';

<Tabs>

<TabItem value="program" label="Nada program" default>
```python reference showGithubLink
https://github.com/NillionNetwork/nada-by-example/blob/main/src/random_number.py
```
</TabItem>

<TabItem value="test" label="Test file">
```yaml reference showGithubLink
https://github.com/NillionNetwork/nada-by-example/blob/main/tests/random_number_test.yaml
```
</TabItem>
</Tabs>

<TestProgram programName="random_number"/>
3 changes: 2 additions & 1 deletion sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion src/components/TestProgram/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const TestProgram = ({ programName, testFileName }) => {

<h4>1. Open "Nada by Example"</h4>
<a
href="https://gitpod.io/#https://github.com/oceans404/nada-by-example"
href="https://gitpod.io/#https://github.com/nillionnetwork/nada-by-example"
target="_blank"
>
<img
Expand Down

0 comments on commit a3ad480

Please sign in to comment.