This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| %! | |
| %%BoundingBox: 0 0 120 120 | |
| /n 3 def/p{count n 2 mul le{dup rotate dup neg 2{p 4 0 rlineto dup}repeat neg | |
| p dup neg rotate}if pop}def 8 8 moveto 90 p stroke |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (gnotation (/* As */ Bs) ((Bs)) ( | |
| /* block- | |
| comments */ | |
| add 20 | |
| (notation (-- A Bs) ((Bs)) ( | |
| --single_comment | |
| --( or use parenthesis | |
| like this ) | |
| 22 | |
| )) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/cli/cli.go b/cli/cli.go | |
| index 6c5fcad..95fb019 100644 | |
| --- a/cli/cli.go | |
| +++ b/cli/cli.go | |
| @@ -53,6 +53,7 @@ type flagopts struct { | |
| InputRaw bool `short:"R" long:"raw-input" description:"read input as raw strings"` | |
| InputSlurp bool `short:"s" long:"slurp" description:"read all inputs into an array"` | |
| FromFile string `short:"f" long:"from-file" description:"load query from file"` | |
| + Destructive bool `short:"D" long:"destructive" description:"update objects/arrays destructive (WARNING: iterator may produce unexpected results)"` | |
| Version bool `short:"v" long:"version" description:"print version"` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def count(n) | |
| c = 0 | |
| while n >= 10 | |
| m = 1 | |
| while n > 0 && m > 0 | |
| m *= n % 10 | |
| n /= 10 | |
| end | |
| n = m | |
| c += 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (declaim (optimize (speed 3) (debug 0) (safety 0))) | |
| (defun count-loop (n) | |
| (declare (type integer n)) | |
| (let ((r 0)) | |
| (loop while (>= n 10) do | |
| (do ((i n) | |
| (p 1)) | |
| ((or (= p 0) (= i 0)) | |
| (setq n p)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;;; http://golf.shinh.org/p.rb?FizzBuzz#Common%20LISP | |
| ;; 80bytes | |
| (dotimes(i 101)(format(> i 0)"~[~;~A~;~;Fizz~;~;Buzz~:;FizzBuzz~] | |
| "(gcd i 15)i)) | |
| ;; 79bytes | |
| (dotimes'101(format(> .'0)"~[~;~A~;~;Fizz~;~;Buzz~:;FizzBuzz~] | |
| "(gcd .'15).'t)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /k{1 add dup 5 eq{5 0 rlineto 5 0 translate}{[0 1 4 4 2 2 5]{60 mul rotate | |
| dup k}forall}ifelse pop}def 30 180 moveto 3{0 k 120 rotate}repeat stroke |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @require: stdja | |
| @require: list | |
| @require: geom | |
| @require: gr | |
| let arrow-head color lenL lenM lenP ((x, y) as pt) theta = | |
| let theta = theta +. math-pi in | |
| let (cx, cy) = (x +' lenL *' (cos theta), y +' lenL *' (sin theta)) in | |
| let (mx, my) = (x +' lenM *' (cos theta), y +' lenM *' (sin theta)) in | |
| let phi = theta +. math-pi /. 2. in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @require: stdja | |
| @require: list | |
| @require: gr | |
| let points = [(100pt, 0pt); (0pt, 100pt); (200pt, 200pt); (300pt, 200pt)] | |
| let curve = | |
| let (p1 :: (p2 :: (p3 :: (p4 :: _)))) = points in | |
| start-path p1 | |
| |> bezier-to p2 p3 p4 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.