Drawlispとは何なんだナ?
1 :スプリンギン :2024/07/02(火) 16:44:02.50 ID:geI2rLqQF Drawlispとは何なんだナ?https://github.com/OliveIsAWord/DrawLisp 2023年制作のプログラミング言語https://oliveisaword.itch.io/drawlisp ラムダ式をデフォで使う必要がある 作者の他の作品https://oliveisaword.itch.io/iamtheplatform https://github.com/OliveIsAWord/picross https://github.com/OliveIsAWord/Bling 参考https://youtu.be/9IxUKpGhoro https://youtu.be/4AyySJ0BaNE?si=ODzwASTjDQyx0jMz
2 :デフォルトの名無しさん :2024/07/02(火) 18:16:53.77 ID:geI2rLqQF let :fill-color #ff000011 let :stroke-color #00000011 let start-time (time-ns) (create-window 400 400) for-each (range 100)(lambda x (line (+ x 100) (+ x 100) 300 (+ 400 (- 100 (/ (* x x) 24)))) (range 100) ) for-each (range 100)(lambda x (line (+ x 300) (+ x 100) 100 (+ 100 (- 600 (/ (* x x) 24)))) (range 100) ) (map(lambda x (line (+ (* x 6) 100) 150 100 100))(range 10)) (map(lambda x (line (+ (* x 6) 200) 150 250 100))(range 10)) (rect 100 155 160 120) (rect 120 180 30 30) (rect 190 180 30 30) for-each (range 30)(lambda i (let x (* i 10)) (rect i 280 x x))
3 :デフォルトの名無しさん :2024/07/02(火) 19:22:33.45 ID:geI2rLqQF let :fill-color #ffAAAA11 let :stroke-color #00AAAA11 let start-time (time-ns) (create-window 400 400) for-each (range 100)(lambda i (let x (* i 10)) (rect i i x x)) ) (let x1 30) (let y1 130) (let sizx1 60) (let sizy1 60) let draw-cool-box (lambda (x y) (let :stroke-color #00111111) (let :fill-color #00111111) (rect x y 50 50) ) (map (lambda x (rect (* x 10) (* x 10) x1 100))(range 10)) for-each (range 90)(lambda i (draw-cool-box (rand-int 256) (rand-int 256)) (let :stroke-color (color (rand-int 256) (rand-int 256) (rand-int 256) 30)) (let :fill-color (color (rand-int 256) (rand-int 256) (rand-int 256) 30)) (line (rand-int 400) (rand-int 300) (rand-int 400) (rand-int 300)) (rect (rand-int 400) (rand-int 300) (rand-int 400) (rand-int 300)) (draw))
4 :デフォルトの名無しさん :2024/07/03(水) 19:19:15.54 ID:vQwYDjc1K Drawlispのジュエルキャットを作ったので使ってくださいませ(改行して) ##Drawlisp Jewel Cat let :fill-color #ff000011let :stroke-color #00000011let start-time (time-ns) (create-window 400 400) for-each (range 90)(lambda i (let :fill-color (color (+ (rand-int 76) 180)(+ (rand-int 76) 180)(+ (rand-int 76) 180) 30)) (rect (rand-int 400)(rand-int 300) (rand-int 400)(rand-int 300)) (line (rand-int 200)(+ 200 (rand-int 200))(+ 200 (rand-int 200))(+ 200 (rand-int 200))) ) for-each (range 1900)(lambda i (let :stroke-color (color (rand-int 256)(rand-int 256) (rand-int 256) 30)) (line (rand-int 200)(+ 200 (rand-int 200))(+ 200 (rand-int 200))(+ 200 (rand-int 200))) ) let :fill-color #ff000011let :stroke-color#00000011 let start-time (time-ns) for-each (range 100)(lambda x (line 100 100 (+ x 10) (- 100 (/ (* x x) 120)))(range 100) ) for-each (range 100)(lambda x (line 200 100 (+ x 110) (- 100 (/ (* x x) 120)))(range 100) ) (rect 30 100 180 120)let :fill-color red (rect 60 130 30 30)(rect 120 130 30 30)let :fill-color white (rect 60 130 16 16)(rect 120 130 16 16)
5 :デフォルトの名無しさん :2024/07/03(水) 19:20:35.76 ID:vQwYDjc1K なんかバグが多いような let start-time (time-ns) (create-window 400 400) let :fill-color #B5E61D let :stroke-color #00000011 let x1 50 let x2 -50 for-each (range 100)(lambda i (let x1 (* i 100)) (rect x1 x1 100 100) ) (rect 300 0 100 100) (rect 200 100 100 100) (rect 100 200 100 100) (rect 0 300 100 100) (draw) let :fill-color #ff000011 let :stroke-color #00000011 let x1 50 let vx1 60 let ax1 3 let y1 100 let vy1 60 let ay1 -1 let vy1 (+ vy1 ay1) for-each (range 300)(lambda x (let vy1 (+ vy1 ay1)) (line 100 100 x vy1) (range 100) (draw) )
6 :デフォルトの名無しさん :2024/07/03(水) 19:21:57.02 ID:vQwYDjc1K 半透明画像を出力するのがデフォなので 宝石好きに良いかと
7 :デフォルトの名無しさん :2024/07/03(水) 21:12:08.92 ID:vQwYDjc1K Drawlispでwhile the escapeを作った let :fill-color #ff000011 let :stroke-color #00000011 let start-time (time-ns) (create-window 400 400) ## Why x1 for while escape? let x1 6 let y1 13 let z1 2 while (neq? (*(+ y1 (* (* x1 x1) x1)) (* z1 z1)) 916) (print "loop") ## Why x1 for while escape? let x1 12 let y1 12 let z1 6 while (neq? (- (* x1 y1) z1) 138) (print "loop")
8 :デフォルトの名無しさん :2024/07/04(木) 19:02:41.56 ID:wJBclQLlC ifの使い方が分からないだろうから書いてあげるんだナ let :fill-color #ff000011 let :stroke-color #00000011 let start-time (time-ns) (create-window 400 400) ## Why x1 for while escape? let x1 6 let x2 4 for-each (range 10)(lambda i (if(eq? i 6)(print "shark"))(range 10) (if(neq? i 6)(print "doo"))(range 10) ) if(eq? x1 x1)(print "doo")
9 :デフォルトの名無しさん :2024/07/04(木) 20:34:54.27 ID:mRmDCas5R rustの作品がコンパイルできないhttps://github.com/OliveIsAWord/kajam15 https://github.com/OliveIsAWord/UndertaleModTool https://github.com/OliveIsAWord/OliveIsAWord.github.io https://github.com/OliveIsAWord/wasm4 ふむふむ
10 :デフォルトの名無しさん :2024/07/06(土) 00:03:41.31 ID:Dq1NV9UqD const std = @import("std");const Allocator = std.mem.Allocator; const io = std.io; const Sexp = enum {Int(i64),Symbol([]const u8),List([...]Sexp),}; const Env = struct { allocator: *Allocator, bindings: std.HashMap([]const u8, Sexp),}; fn evaluate(env: *Env, sexp: Sexp) Sexp {switch (sexp) {Sexp.Int(_) => return sexp, Sexp.Symbol(symbol) => {const found = env.bindings.get(symbol); if (found == null) {io.warn.print("Undefined symbol: {}\n", .{symbol}); return Sexp.Symbol("undefined".ptr);}return found.*;}, Sexp.List([first, ..rest]) => {const operator = evaluate(env, first); switch (operator){Sexp.Symbol("+".ptr) => {var result: i64 = 0; for (rest) |item| {result += evaluate(env, item).Int; }return Sexp.Int(result);}, Sexp.Symbol("-".ptr) => { if (rest.len != 2) {io.warn.print("Invalid number of arguments for -: {}\n", .{rest.len}); return Sexp.Symbol("error".ptr);} const arg1 = evaluate(env, rest[0]).Int;const arg2 = evaluate(env, rest[1]).Int; return Sexp.Int(arg1 - arg2);}, _ => {io.warn.print("Unknown operator: {}\n", .{operator}); return Sexp.Symbol("error".ptr);},}},}} pub fn main() void { const allocator = std.heap.page_allocator; var env = Env{.allocator = &allocator,.bindings = std.HashMap([]const u8, Sexp).init(&allocator),}; const code = "[+ 1 2]"; const parsed = std.json.parse(Sexp.List).try(code); if (parsed.status == .ok) { const result = evaluate(&env, parsed.value); io.print("Result: {}\n", .{result.Int}); } else {io.warn.print("Parsing failed: {}\n", .{parsed.error});}}
11 :デフォルトの名無しさん :2024/07/06(土) 00:04:36.58 ID:Dq1NV9UqD zigでリスプという 古ーい言語を再現しようという 東方二次のような低レベルな企画らしい ziglisp github.com/tubo28/ziglisp wisp github.com/mbrock/wisp github.com/rvcas/crisp github.com/levydsa/lisp github.com/dev-gm/lambda-calculus-lisp github.com/hi7/alpha
12 :デフォルトの名無しさん :2024/07/06(土) 00:05:15.22 ID:Dq1NV9UqD Drawlispで数独を作った www.deviantart.com/glogshark/art/1071458985 pastebin.com/zPyEfdqK
13 :デフォルトの名無しさん :2024/07/06(土) 00:08:37.83 ID:Dq1NV9UqD アマチュアの言語は 使うなと言う事だ 低レベルな世界に巻き込まれる
9 KB
新着レスの表示
掲示板に戻る
全部
前100
次100
最新50
read.cgi ver.24052200
本文 スレッドタイトル 投稿者