Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/js13kgames/pymm

pymm - a js13kGames 2022 competition entry by Anacreon (@panjea & @hexatekin).
https://github.com/js13kgames/pymm

2022 competition death game html5 javascript js13k js13kgames js13kgames2022 optimization unfinished

Last synced: 7 days ago
JSON representation

pymm - a js13kGames 2022 competition entry by Anacreon (@panjea & @hexatekin).

Awesome Lists containing this project

README

        

# py--

- decompress `py--` scripts at runtime into javascript
- includes mini transpiler with user defined macro syntax
- defines smaller CSS and DOM API

## syntax: local variables
RULE: no space before equals is assignment to a local variable.

py--
```python
a= b
```
js translation:
```javascript
var a= b
```

## syntax: global variables
RULE: a space before equals is assignment to a global variable.
RULE: or no spaces at all is assignment to a global

py--
```python
a =b
a=b
```
js translation:
```javascript
a =b
a=b
```

## syntax: for loop
RULE: for loop symbol is `@`.
- in short form `@ a` translates to `for i in range(len(a))`, the default loop index variable is `i`
- long form is `@ j a`, this sets the loop index variable to `j`
- a blank new line terminates the loop (appends `}` to the js translation)

py--
```python
a= [1,2,3]
@ a
console.log('index', i)
console.log('value', a[i])

```
js translation:
```javascript
var a =[1,2,3]
for(i=0;i