Skip to content

Use the size of the examples as the complexity indicator #138

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ jobs:
- name: Run Tests
run: |
make
./build/b -run -t 6502 ./examples/10_hello_world.b ./std/6502.b
./build/b -run -t 6502 ./examples/hello_world.b ./std/6502.b
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Compiler for the B Programming Language implemented in [Crust](https://github.co

```console
$ make
$ ./build/b -run ./examples/10_hello_world.b
$ ./build/b -run ./examples/hello_world.b
```

### Uxn
Expand All @@ -32,7 +32,7 @@ $ ./build/b -run ./examples/10_hello_world.b
The compiler supports [Uxn](https://100r.co/site/uxn.html) target. Make sure you have `uxnemu` in your `$PATH` if you want to use `-run` flag.

```console
$ ./build/b -t uxn -run ./examples/10_hello_world.b ./std/uxn.b
$ ./build/b -t uxn -run ./examples/hello_world.b ./std/uxn.b
```

Also check out more examples at [./examples/](./examples/).
Expand Down
1 change: 1 addition & 0 deletions examples/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
!*/
!**/*.b
!.gitignore
!**/README.md
15 changes: 15 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Examples

This folder contains examples that are meant to be read by the users of the language to learn and explore the capabilities of the language.

It is recommended to study them in the order of their complexity: from simplest to the most complex. Generally, the size of the file roughly corresponds to its complexity so we recommend to sort the examples by their size and follow that order.

In a Linux console this could be achived by the running command:

```
$ ls -lS
```

Where the `-S` flag of the [ls](https://man7.org/linux/man-pages/man1/ls.1.html) utility sorts the files by size, largest first.

In other operating systems and applications please use similar functionality.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions examples/uxn/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Uxn Examples

Here we keep examples for the [Uxn](https://100r.co/site/uxn.html). They are weird enough to deserve a dedicated folder.
File renamed without changes.
File renamed without changes.
File renamed without changes.