https://github.com/hellerve/golflisp
A few macros and aliases for zepto for better code golf performance
https://github.com/hellerve/golflisp
Last synced: 4 days ago
JSON representation
A few macros and aliases for zepto for better code golf performance
- Host: GitHub
- URL: https://github.com/hellerve/golflisp
- Owner: hellerve
- Created: 2016-05-30T08:34:39.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-05-30T09:34:16.000Z (almost 10 years ago)
- Last Synced: 2025-09-16T13:26:19.576Z (6 months ago)
- Size: 1.95 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# golflisp
A few macros and aliases for zepto for better code golf performance.
## Installation
Don't.
But if you really want to, `zeps install hellerve/golflisp` is your friend.
## Why
```
$ cat fizzbuzz.zp
(for 100 ((write (cond ((= (mod i 15) 0) "fizzbuzz") ((= (mod i 5) 0) "fizz") ((= (mod i 3) 0) "buzz") (else i)))))
$ wc -c fizzbuzz.zp
116 fizzbuzz.zp
$ cat fizzbuzz-golf.zp
(Σ 100 ((w (Ο ((n? (% i 15)) "fizzbuzz") ((n? (% i 5)) "fizz") ((n? (% i 3)) "buzz") (χ i)))))
$ wc -c fizzbuzz-golf.zp
98 fizzbuzz-golf.zp
```
Also the code gets less readable, which is nice.
Cheers