Femcode is a femboy-themed programming language designed to be simple, expressive, and fun. It features a unique syntax inspired by femboy terminology, making coding an adorable experience.
## Table of Contents
1. [Getting Started](#getting-started)
2. [Basic Syntax](#basic-syntax)
3. [Variables and Assignment](#variables-and-assignment)
To run Femcode programs, you can use the `femterpreter` wrapper script. This script simplifies running your `.fem` files without needing to navigate to the `src` directory or explicitly call `python3 main.py`.
### Running Femcode Programs
Once you have the `femterpreter` script, you can run your Femcode programs like this:
Strings are sequences of characters enclosed in double quotes.
```femcode
my_string is "Hello, world!"
```
### Booleans
Femcode has two boolean values: `Kawaii` (True) and `Cringe` (False).
```femcode
is_cute is Kawaii
is_bad is Cringe
```
### Lists
Lists are ordered collections of items, enclosed in square brackets `[]` and separated by commas.
```femcode
my_list is [1, "apple", Kawaii]
```
Elements can be accessed using zero-based indexing:
```femcode
UwU Boy my_list[0] # Prints 1
```
### Dictionaries
Dictionaries are unordered collections of key-value pairs, enclosed in curly braces `{}`. Keys and values are separated by a colon `:`, and pairs are separated by commas.
```femcode
my_dict is {"name": "Femboy", "version": 1.0}
```
Values can be accessed using dot notation (property access):
Functions are defined using the `Femboy` keyword, followed by the function name, optional parameters in parentheses, and a code block enclosed by `Femboycore` and `Periodt`.
```femcode
Femboy say_hello() Femboycore
UwU Boy "Hello from function!"
Periodt
Femboy add_numbers(a, b) Femboycore
Femme a + b
Periodt
```
### Calling Functions
Functions are called by their name followed by parentheses, enclosing any arguments.
```femcode
say_hello()
result is add_numbers(10, 5)
```
### Return Values
Use the `Femme` keyword to return a value from a function.
```femcode
Femboy get_kawaii_status() Femboycore
Femme Kawaii
Periodt
status is get_kawaii_status()
UwU Boy status # Prints Kawaii
```
### Built-in Functions
Femcode provides several built-in functions for common tasks:
*`ask(prompt)`: Prompts the user for input and returns it as a string.
```femcode
name is ask("What's your name, femboy? ")
UwU Boy "Hello, " + name + "!"
```
*`len(value)`: Returns the length of a string or a list.
```femcode
my_string is "Cute"
my_list is [1, 2, 3]
UwU Boy len(my_string) # Prints 4
UwU Boy len(my_list) # Prints 3
```
*`type(value)`: Returns the type of a value as a string (e.g., "int", "str", "list", "dict", "bool").
```femcode
UwU Boy type(123) # Prints "int"
UwU Boy type("hello") # Prints "str"
UwU Boy type(Kawaii) # Prints "bool"
```
## 8. Comments
Single-line comments start with a `#` symbol. Anything after `#` on the same line is ignored by the interpreter.
```femcode
# This is a single-line comment
UwU Boy "Hello, Femcode!" # This is also a comment
```
## 9. Input/Output
Input is handled via the `ask` built-in function, and output is handled via the `UwU Boy` (print) command.