Skip to content

Commit f7b700b

Browse files
committed
Improve emojicode guide
It was inconsistent with reality, which confused AIs ability to write emojicode
1 parent c471832 commit f7b700b

1 file changed

Lines changed: 62 additions & 38 deletions

File tree

β€Žemojicode/fraglet/guide.mdβ€Ž

Lines changed: 62 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,87 @@
1-
# EmojiCode Fraglet Guide
1+
# Emojicode Fraglet Guide
22

33
## Language Version
4-
EmojiCode (compiled language)
4+
Emojicode (as installed in this container; run `emojicodec --version` inside the container if you need the exact version).
55

66
## Execution Model
7-
- Compiled via `emojicodec` compiler
8-
- Produces native binary executable
7+
- **Compiled language** using the `emojicodec` compiler.
8+
- Your fraglet **replaces the entire contents** between `πŸ’­ BEGIN_FRAGLET` and `πŸ’­ END_FRAGLET` in `hello-world.πŸ‡`.
9+
- The resulting file is compiled and run as a normal Emojicode program.
10+
11+
## Key Characteristics
12+
- **Emoji-based syntax** for all core constructs (entry point, blocks, variables, printing, comments).
13+
- **Compiled to native code**; errors are reported by `emojicodec` with file/position info.
14+
- **Block-structured** with explicit start (`πŸ‡`) and end (`πŸ‰`) delimiters.
15+
- **Statement-terminated** with `❗️`.
916

1017
## Fragment Authoring
11-
Write a complete EmojiCode program. Your fragment replaces the entire source file.
18+
- **You write a complete Emojicode program.** Your fraglet is not injected into `main` or any other function body.
19+
- You must include:
20+
- Program entry: `🏁`
21+
- A top-level block: `πŸ‡` ... `πŸ‰`
22+
- Whatever statements you want to run inside that block.
23+
- The minimal shape looks like:
24+
25+
```emojicode
26+
🏁 πŸ‡
27+
…your statements…
28+
πŸ‰
29+
```
30+
31+
## Mental Model
32+
You write a **full, valid Emojicode program**, starting with `🏁` and a `πŸ‡ … πŸ‰` block, and we **compile and run it as-is**.
33+
Nothing is injected for you and no `main` wrapper is added – if your program wouldn’t compile with `emojicodec` on its own, it won’t compile as a fraglet.
1234

1335
## Basic Syntax
14-
- `🏁` - Main function entry point
15-
- `πŸ‡` / `πŸ‰` - Block start / end
16-
- `πŸ˜€` - Print statement
17-
- `πŸ”€...πŸ”€` - String literal delimiters
18-
- `❗️` - Statement terminator
19-
- `πŸ’­` - Comment marker
36+
- `🏁` – Program entry point.
37+
- `πŸ‡` / `πŸ‰` – Block start / end.
38+
- `πŸ˜€` – Print statement.
39+
- `πŸ”€β€¦πŸ”€` – String literal delimiters.
40+
- `❗️` – Statement terminator.
41+
- `πŸ’­` – Comment / annotation.
2042

2143
## Variables and Types
22-
- `πŸ–πŸ†•` - Declare a mutable variable
23-
- `πŸ”’` - Integer type
24-
- `πŸ”‘` - String type
25-
- Declaration: `πŸ–πŸ†• x πŸ”’ 5`
26-
27-
## Conditionals
28-
- `β†ͺ️` - If
29-
- `πŸ™…` - Else
30-
- `πŸ™…β†ͺ️` - Else-if
31-
- `πŸ‘` / `πŸ‘Ž` - True / False
44+
- `πŸ–πŸ†•` – Declare a mutable variable.
45+
- Common types:
46+
- `πŸ”’` – Integer.
47+
- `πŸ”‘` – String.
48+
- Example declaration:
3249

33-
## Examples
3450
```emojicode
35-
🏁 πŸ‡
36-
πŸ˜€ πŸ”€Hello World!πŸ”€β—οΈ
37-
πŸ‰
51+
πŸ–πŸ†• x πŸ”’ 5❗️
3852
```
3953

54+
## Examples
55+
56+
### Minimal Hello World
57+
This is the smallest program you should expect to compile and run as a fraglet in this vein:
58+
4059
```emojicode
4160
🏁 πŸ‡
42-
πŸ˜€ πŸ”€First lineπŸ”€β—οΈ
43-
πŸ˜€ πŸ”€Second lineπŸ”€β—οΈ
61+
πŸ˜€ πŸ”€Hello from Emojicode fraglet!πŸ”€β—οΈ
4462
πŸ‰
4563
```
4664

65+
### Variables and printing
66+
A slightly richer example with a variable and formatted output:
67+
4768
```emojicode
4869
🏁 πŸ‡
49-
πŸ–πŸ†• x πŸ”’ 5
50-
β†ͺ️ πŸ‘ πŸ‡
51-
πŸ˜€ πŸ”€True!πŸ”€β—οΈ
52-
πŸ‰
53-
πŸ™… πŸ‡
54-
πŸ˜€ πŸ”€False!πŸ”€β—οΈ
55-
πŸ‰
70+
πŸ–πŸ†• times πŸ”’ 3❗️
71+
πŸ˜€ πŸ”€About to greetβ€¦πŸ”€β—οΈ
72+
πŸ˜€ πŸ”€Hello πŸ”€β—οΈ
73+
πŸ˜€ πŸ”€We greeted πŸ”€β—οΈ
74+
πŸ˜€ πŸ”€times: πŸ”€β—οΈ
75+
πŸ˜€ times❗️
5676
πŸ‰
5777
```
5878

79+
Both examples are complete programs: if you drop them between `πŸ’­ BEGIN_FRAGLET` and `πŸ’­ END_FRAGLET` in `hello-world.πŸ‡`, they should compile and run under this fraglet vein.
80+
5981
## Caveats
60-
- Ensure your editor supports Unicode emoji characters
61-
- String literals must be wrapped in `πŸ”€` delimiters
62-
- Statements end with `❗️`
63-
- Variable declarations require `πŸ–πŸ†•` prefix
82+
- **Full program required**: Fragments that are just statements like `πŸ˜€ πŸ”€HelloπŸ”€β—οΈ` without `🏁 πŸ‡` … `πŸ‰` will fail to compile.
83+
- **Compiler errors are authoritative**: If execution fails, read the `emojicodec` error message and iterate until it compiles – this guide describes the expected structure, but the compiler is the final arbiter.
84+
- Ensure your editor supports **Unicode emoji** so characters are preserved correctly.
85+
- **String literals** must be wrapped in `πŸ”€` delimiters.
86+
- **Every statement** (including variable declarations and prints) must end with `❗️`.
87+
- Variable declarations require the `πŸ–πŸ†•` prefix and an appropriate type emoji.

0 commit comments

Comments
Β (0)