isorite 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +1 -1
- package/package.json +1 -1
- package/web/_app/immutable/assets/5.CUzWicH8.css +1 -0
- package/web/_app/immutable/assets/9.CFA9_nYZ.css +1 -0
- package/web/_app/immutable/assets/{NoteEditor.Bp-YDqYj.css → NoteEditor.CM4-yBF-.css} +1 -1
- package/web/_app/immutable/assets/Tutorial.BBInFlVA.css +1 -0
- package/web/_app/immutable/chunks/{gRYnlonl.js → 3kOo0zFs.js} +1 -1
- package/web/_app/immutable/chunks/{DN3dk6rD.js → 7G70dile.js} +3 -3
- package/web/_app/immutable/chunks/BC72R-M3.js +3 -0
- package/web/_app/immutable/chunks/{B-si2ell.js → BDArRuPR.js} +1 -1
- package/web/_app/immutable/chunks/BIIfi70-.js +1 -0
- package/web/_app/immutable/chunks/CRzLMJPS.js +1 -0
- package/web/_app/immutable/chunks/Cu92X5fL.js +1 -0
- package/web/_app/immutable/chunks/DZgc09PI.js +535 -0
- package/web/_app/immutable/chunks/{cmGruEKS.js → DhNgPNiM.js} +1 -1
- package/web/_app/immutable/chunks/DxgbXXT0.js +13 -0
- package/web/_app/immutable/chunks/VWXhPrtT.js +1 -0
- package/web/_app/immutable/chunks/czZbKOPp.js +1 -0
- package/web/_app/immutable/entry/app.CNsoor0D.js +2 -0
- package/web/_app/immutable/entry/start.DFtkKs7u.js +1 -0
- package/web/_app/immutable/nodes/0.156ZLyOF.js +2 -0
- package/web/_app/immutable/nodes/1.e1XDhJNT.js +1 -0
- package/web/_app/immutable/nodes/2.80TQrqQF.js +1 -0
- package/web/_app/immutable/nodes/3.Bk_l60Ut.js +13 -0
- package/web/_app/immutable/nodes/4.CektBUbm.js +2 -0
- package/web/_app/immutable/nodes/5.65PWTBsr.js +4 -0
- package/web/_app/immutable/nodes/6.a_57GKer.js +1 -0
- package/web/_app/immutable/nodes/7.DbM_N4_u.js +1 -0
- package/web/_app/immutable/nodes/8.CY3JWStn.js +1 -0
- package/web/_app/immutable/nodes/9.DurALis5.js +530 -0
- package/web/_app/version.json +1 -1
- package/web/index.html +19 -11
- package/web/_app/immutable/assets/5.BCvLF9Xz.css +0 -1
- package/web/_app/immutable/chunks/BD1Dpm2e.js +0 -3
- package/web/_app/immutable/chunks/C0fpmehI.js +0 -1
- package/web/_app/immutable/chunks/CWYACT2V.js +0 -1
- package/web/_app/immutable/chunks/CdQZ-ArP.js +0 -1
- package/web/_app/immutable/chunks/DtAOoM-T.js +0 -1
- package/web/_app/immutable/chunks/DykrN7z5.js +0 -535
- package/web/_app/immutable/entry/app.DgJiXIYs.js +0 -2
- package/web/_app/immutable/entry/start.l9vV7NaJ.js +0 -1
- package/web/_app/immutable/nodes/0.DWPeBju2.js +0 -1
- package/web/_app/immutable/nodes/1.CJVDS8FT.js +0 -1
- package/web/_app/immutable/nodes/2.o8ItfT-a.js +0 -1
- package/web/_app/immutable/nodes/3.uhHyOPGK.js +0 -13
- package/web/_app/immutable/nodes/4.BYKkAZTp.js +0 -2
- package/web/_app/immutable/nodes/5.BzEQO7Xv.js +0 -4
- package/web/_app/immutable/nodes/6.GxiAUa6J.js +0 -1
- package/web/_app/immutable/nodes/7.d2Ere8Jb.js +0 -1
- package/web/_app/immutable/nodes/8.CvPHZL8j.js +0 -1
|
@@ -0,0 +1,530 @@
|
|
|
1
|
+
import{A as e,E as t,H as n,I as r,J as i,K as a,N as o,O as s,P as c,Q as l,V as u,Y as d,Z as f,at as p,ct as m,et as h,h as g,it as _,lt as v,n as y,s as b,u as x,x as S}from"../chunks/BC72R-M3.js";import"../chunks/xihTtKlq.js";var C={cols:160,rows:44,frames:[{step:0,title:`isorite in the terminal`,text:`OpenCode, an agent that writes code, with your notes beside it: a developer's notes on an N-body simulation, and an empty folder for the code. The browser that opened is the other half, on the same notes. The model is scripted. Press enter to open.`,does:`press enter`,screen:`\x1B[38;2;255;255;255m\x1B[48;2;7;16;28m
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
\x1B[38;2;233;238;245m \x1B[38;2;240;190;74m▗▟██▙▖ \x1B[38;2;255;255;255m
|
|
10
|
+
\x1B[38;2;233;238;245m \x1B[38;2;240;190;74m▝▜██▛▘ \x1B[38;2;255;255;255m
|
|
11
|
+
\x1B[38;2;233;238;245m \x1B[38;2;255;255;255m
|
|
12
|
+
\x1B[38;2;233;238;245m ▗▟▛▘\x1B[38;2;255;255;255m
|
|
13
|
+
\x1B[38;2;233;238;245m ▗▟▛▘ \x1B[38;2;255;255;255m
|
|
14
|
+
\x1B[38;2;233;238;245m ▗▟▛▘ \x1B[38;2;255;255;255m
|
|
15
|
+
\x1B[38;2;233;238;245m ▗▟▛▘ \x1B[38;2;255;255;255m
|
|
16
|
+
\x1B[38;2;233;238;245m▝▜▙▖ ██ \x1B[38;2;255;255;255m
|
|
17
|
+
\x1B[38;2;233;238;245m ▝▜▙▖ ██ \x1B[38;2;255;255;255m
|
|
18
|
+
\x1B[38;2;233;238;245m ▝▜▙▖ ██ \x1B[38;2;255;255;255m
|
|
19
|
+
\x1B[38;2;233;238;245m ▝▜▙▖██ \x1B[38;2;255;255;255m
|
|
20
|
+
\x1B[38;2;233;238;245m ▝▜██ \x1B[38;2;255;255;255m
|
|
21
|
+
\x1B[38;2;233;238;245m ██ \x1B[38;2;255;255;255m
|
|
22
|
+
\x1B[38;2;233;238;245m ██ \x1B[38;2;255;255;255m
|
|
23
|
+
\x1B[38;2;233;238;245m ██ \x1B[38;2;255;255;255m
|
|
24
|
+
|
|
25
|
+
\x1B[1m\x1B[38;2;233;238;245m i s o r i t e\x1B[0m\x1B[38;2;255;255;255m\x1B[48;2;7;16;28m
|
|
26
|
+
|
|
27
|
+
\x1B[38;2;180;192;210mnbody-notes · 18 notes · study base found\x1B[38;2;255;255;255m
|
|
28
|
+
|
|
29
|
+
\x1B[38;2;7;16;28m\x1B[48;2;233;238;245m [enter] open \x1B[38;2;180;192;210m\x1B[48;2;7;16;28m [a] atlas in the browser [?] keys [q] quit\x1B[38;2;255;255;255m
|
|
30
|
+
\x1B[38;2;240;190;74m╭─ tour · 1 of 12 ─────────────────────────────╮\x1B[38;2;255;255;255m
|
|
31
|
+
\x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[1m\x1B[38;2;233;238;245misorite in the terminal\x1B[0m\x1B[38;2;255;255;255m\x1B[48;2;7;16;28m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
32
|
+
\x1B[38;2;35;57;90m : : \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;180;192;210mOpenCode, an agent that writes code, with \x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
33
|
+
\x1B[38;2;35;57;90m : : : : \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;180;192;210myour notes beside it: a developer's notes on\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
34
|
+
\x1B[38;2;35;57;90m : : \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;180;192;210man N-body simulation, and an empty folder \x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
35
|
+
\x1B[38;2;35;57;90m : : \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;180;192;210mfor the code. The browser that opened is the\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
36
|
+
\x1B[38;2;35;57;90m : \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;180;192;210mother half, on the same notes. The model is \x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
37
|
+
\x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;180;192;210mscripted. Press enter to open.\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
38
|
+
\x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
39
|
+
\x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m■\x1B[38;2;35;57;90m□□□□□□□□□□□\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m/tour hides\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
40
|
+
\x1B[38;2;240;190;74m╰──────────────────────────────────────────────╯\x1B[38;2;255;255;255m
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
\x1B[48;2;12;24;40m \x1B[38;2;135;150;173m⠸\x1B[38;2;255;255;255m \x1B[38;2;135;150;173mFinishing startup…\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m
|
|
44
|
+
|
|
45
|
+
`},{step:1,title:`Ask for code`,text:`The prompt is filled in. Press enter. Before it writes, the agent looks in your notes: by words, by meaning, and along their links. OpenCode asks before it writes a file: allow it.`,does:`press enter, and allow the write`,screen:`\x1B[38;2;255;255;255m\x1B[48;2;7;16;28m
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
\x1B[38;2;135;150;173m \x1B[38;2;255;255;255m \x1B[1m\x1B[38;2;233;238;245m ▄ \x1B[0m\x1B[38;2;255;255;255m\x1B[48;2;7;16;28m
|
|
62
|
+
\x1B[38;2;135;150;173m█▀▀█ █▀▀█ █▀▀█ █▀▀▄\x1B[38;2;255;255;255m \x1B[1m\x1B[38;2;233;238;245m█▀▀▀ █▀▀█ █▀▀█ █▀▀█\x1B[0m\x1B[38;2;255;255;255m\x1B[48;2;7;16;28m
|
|
63
|
+
\x1B[38;2;135;150;173m█\x1B[48;2;39;50;64m \x1B[48;2;7;16;28m█ █\x1B[48;2;39;50;64m \x1B[48;2;7;16;28m█ █\x1B[48;2;39;50;64m▀▀▀\x1B[48;2;7;16;28m █\x1B[48;2;39;50;64m \x1B[48;2;7;16;28m█\x1B[38;2;255;255;255m \x1B[1m\x1B[38;2;233;238;245m█\x1B[48;2;64;72;82m \x1B[48;2;7;16;28m █\x1B[48;2;64;72;82m \x1B[48;2;7;16;28m█ █\x1B[48;2;64;72;82m \x1B[48;2;7;16;28m█ █\x1B[48;2;64;72;82m▀▀▀\x1B[0m\x1B[38;2;255;255;255m\x1B[48;2;7;16;28m
|
|
64
|
+
\x1B[38;2;135;150;173m▀▀▀▀ █▀▀▀ ▀▀▀▀ ▀\x1B[38;2;39;50;64m▀▀\x1B[38;2;135;150;173m▀\x1B[38;2;255;255;255m \x1B[1m\x1B[38;2;233;238;245m▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀\x1B[0m\x1B[38;2;255;255;255m\x1B[48;2;7;16;28m
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
\x1B[38;2;240;190;74m┃\x1B[38;2;255;255;255m\x1B[48;2;18;34;56m \x1B[48;2;7;16;28m
|
|
68
|
+
\x1B[38;2;240;190;74m┃\x1B[38;2;255;255;255m\x1B[48;2;18;34;56m \x1B[38;2;233;238;245mwrite sim.py: two bodies on a circular orbit, stepped with leapfrog, \x1B[38;2;255;255;255m \x1B[48;2;7;16;28m
|
|
69
|
+
\x1B[38;2;240;190;74m┃\x1B[38;2;255;255;255m\x1B[48;2;18;34;56m \x1B[38;2;233;238;245mas my notes say\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m
|
|
70
|
+
\x1B[38;2;240;190;74m┃\x1B[38;2;255;255;255m\x1B[48;2;18;34;56m \x1B[48;2;7;16;28m
|
|
71
|
+
\x1B[38;2;240;190;74m┃\x1B[38;2;255;255;255m\x1B[48;2;18;34;56m \x1B[38;2;240;190;74mBuild\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m·\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mscripted\x1B[38;2;255;255;255m \x1B[38;2;135;150;173mGateway\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m
|
|
72
|
+
\x1B[38;2;240;190;74m╹\x1B[38;2;18;34;56m▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀\x1B[38;2;255;255;255m
|
|
73
|
+
\x1B[38;2;135;150;173m~/tour/code\x1B[38;2;255;255;255m \x1B[38;2;135;150;173mnbody-notes\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mshift+tab \x1B[38;2;135;150;173magents\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mctrl+p \x1B[38;2;135;150;173mcommands\x1B[38;2;255;255;255m
|
|
74
|
+
|
|
75
|
+
\x1B[38;2;240;190;74m╭─ tour · 2 of 12 ─────────────────────────────╮\x1B[38;2;255;255;255m
|
|
76
|
+
\x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[1m\x1B[38;2;233;238;245mAsk for code\x1B[0m\x1B[38;2;255;255;255m\x1B[48;2;7;16;28m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
77
|
+
\x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;180;192;210mThe prompt is filled in. Press enter. Before\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
78
|
+
\x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;180;192;210mit writes, the agent looks in your notes: by\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
79
|
+
\x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;180;192;210mwords, by meaning, and along their links. \x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
80
|
+
\x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;180;192;210mOpenCode asks before it writes a file: allow\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
81
|
+
\x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;180;192;210mit.\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
82
|
+
\x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
83
|
+
\x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m■■\x1B[38;2;35;57;90m□□□□□□□□□□\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m/tour hides\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
84
|
+
\x1B[38;2;240;190;74m╰──────────────────────────────────────────────╯\x1B[38;2;255;255;255m
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
\x1B[48;2;12;24;40m \x1B[38;2;135;150;173m⠴\x1B[38;2;255;255;255m \x1B[38;2;135;150;173mFinishing startup…\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[38;2;135;150;173m2.0.32\x1B[38;2;255;255;255m
|
|
88
|
+
|
|
89
|
+
`},{step:2,title:`Notes in play`,text:`On the right: what it found, what it reached from there, and what it used, in gold. Its answer cites your notes, [1] and the section. In the browser, the Atlas draws the same path as it goes. Type /next.`,does:`type /next`,screen:`\x1B[48;2;63;67;64m \x1B[1m\x1B[38;2;240;190;74m\x1B[48;2;64;68;64m•\x1B[0m\x1B[48;2;64;68;65m \x1B[1m\x1B[38;2;233;238;245m\x1B[48;2;64;69;65mTwo \x1B[48;2;64;68;65mb\x1B[48;2;61;65;63mo\x1B[48;2;59;63;60md\x1B[48;2;58;62;59mies, stepped with \x1B[38;2;190;197;207ml\x1B[38;2;138;148;162me\x1B[38;2;87;99;116ma\x1B[38;2;35;50;71mp\x1B[0m\x1B[38;2;135;150;173m\x1B[48;2;7;16;28m + \x1B[38;2;255;255;255m
|
|
90
|
+
\x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m5\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mr = np.array([[-0.5, 0.0], [0.5, 0.0]])\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
91
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m6\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mv = np.array([[0.0, -0.5], [0.0, 0.5]])\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[1m\x1B[38;2;233;238;245mTwo bodies, stepped with leapfrog\x1B[0m\x1B[38;2;255;255;255m\x1B[48;2;12;24;40m
|
|
92
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m7\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mdt, steps = 2 * np.pi / 100, 10_000\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
93
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m8\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[1m\x1B[38;2;233;238;245mContext\x1B[0m\x1B[38;2;255;255;255m\x1B[48;2;12;24;40m
|
|
94
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m9\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;135;150;173m15 tokens\x1B[38;2;255;255;255m
|
|
95
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m10\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mdef accelerations(r, m):\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;135;150;173m0% used\x1B[38;2;255;255;255m
|
|
96
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m11\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m d = r[None, :, :] - r[:, None, :] # d[i, j] = r_j - r_i\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
97
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m12\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m d2 = np.sum(d**2, axis=-1)\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m╭─ notes in play ───────────────────╮\x1B[38;2;255;255;255m
|
|
98
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m13\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m np.fill_diagonal(d2, 1.0)\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m6 found · 2 used\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m
|
|
99
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m14\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m inv = d2**-1.5\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m \x1B[38;2;35;57;90m├─ \x1B[38;2;233;238;245mleapfrog\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m◆ used\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m
|
|
100
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m15\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m np.fill_diagonal(inv, 0.0)\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m \x1B[38;2;35;57;90m├─ \x1B[38;2;233;238;245mchoosing the \x1B[38;2;255;255;255m \x1B[38;2;135;150;173mnot opened\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m
|
|
101
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m16\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m return np.einsum("ij,ijk->ik", m[None, :] * inv, d)\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mtimestep\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m
|
|
102
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m17\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m \x1B[38;2;35;57;90m├─ \x1B[38;2;233;238;245mthe main loop\x1B[38;2;255;255;255m \x1B[38;2;180;192;210mread\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m
|
|
103
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m18\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m \x1B[38;2;35;57;90m├─ \x1B[38;2;233;238;245mdiagnostics\x1B[38;2;255;255;255m \x1B[38;2;135;150;173mnot opened\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m
|
|
104
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m19\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mdef energy(r, v, m):\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m \x1B[38;2;35;57;90m├─ \x1B[38;2;233;238;245msymplectic \x1B[38;2;255;255;255m \x1B[38;2;135;150;173mnot opened\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m
|
|
105
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m20\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m return 0.5 * np.sum(m * np.sum(v**2, axis=1)) - m[0] * m[1] / np.linalg.norm(r[0] - r[1])\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mintegrators\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m
|
|
106
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m21\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m \x1B[38;2;35;57;90m└─ \x1B[38;2;233;238;245minitial conditions\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m◆ used\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m
|
|
107
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m22\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m╰───────────────────────────────────╯\x1B[38;2;255;255;255m
|
|
108
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m23\x1B[38;2;255;255;255m \x1B[38;2;233;238;245ma, e0 = accelerations(r, m), energy(r, v, m)\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
109
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m24\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mfor step in range(steps):\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
110
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m25\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m v += 0.5 * dt * a # kick\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
111
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m26\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m r += dt * v # drift\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
112
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m27\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m a = accelerations(r, m)\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
113
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m28\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m v += 0.5 * dt * a # kick\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
114
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m29\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mprint(f"energy drift after {steps * dt / (2 * np.pi):.0f} orbits: {abs(energy(r, v, m) - e0) / abs(e0):.\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
115
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m1e}")\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
116
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m30\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
117
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
118
|
+
\x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
119
|
+
\x1B[48;2;7;16;28m \x1B[38;2;233;238;245msim.py steps the two-body orbit with leapfrog \x1B[38;2;240;190;74m[1]\x1B[38;2;233;238;245m, from the initial conditions in your notes \x1B[38;2;240;190;74m[2]\x1B[38;2;233;238;245m; it prin\x1B[38;2;240;190;74m╭─ tour · 3 of 12 ─────────────────────────────╮\x1B[38;2;255;255;255m\x1B[48;2;12;24;40m
|
|
120
|
+
\x1B[48;2;7;16;28m \x1B[38;2;233;238;245menergy drift, which stays tiny because leapfrog is symplectic.\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[1m\x1B[38;2;233;238;245mNotes in play\x1B[0m\x1B[38;2;255;255;255m\x1B[48;2;7;16;28m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m\x1B[48;2;12;24;40m
|
|
121
|
+
\x1B[48;2;7;16;28m \x1B[38;2;240;190;74m[1]\x1B[38;2;233;238;245m leapfrog\x1B[38;2;135;150;173m § why it does not drift\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;180;192;210mOn the right: what it found, what it reached\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m\x1B[48;2;12;24;40m
|
|
122
|
+
\x1B[48;2;7;16;28m \x1B[38;2;240;190;74m[2]\x1B[38;2;233;238;245m initial conditions\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;180;192;210mfrom there, and what it used, in gold. Its \x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m\x1B[48;2;12;24;40m
|
|
123
|
+
\x1B[48;2;7;16;28m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;180;192;210manswer cites your notes, [1] and the \x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m\x1B[48;2;12;24;40m
|
|
124
|
+
\x1B[48;2;7;16;28m \x1B[38;2;240;190;74mBuild\x1B[38;2;135;150;173m · scripted · 434ms · 228.8 tok/s\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;180;192;210msection. In the browser, the Atlas draws the\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m\x1B[48;2;12;24;40m
|
|
125
|
+
\x1B[48;2;7;16;28m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;180;192;210msame path as it goes. Type /next.\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m\x1B[48;2;12;24;40m
|
|
126
|
+
\x1B[48;2;7;16;28m \x1B[38;2;240;190;74m┃\x1B[38;2;255;255;255m\x1B[48;2;18;34;56m \x1B[38;2;240;190;74m\x1B[48;2;7;16;28m│\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m\x1B[48;2;12;24;40m
|
|
127
|
+
\x1B[48;2;7;16;28m \x1B[38;2;240;190;74m┃\x1B[38;2;255;255;255m\x1B[48;2;18;34;56m \x1B[38;2;240;190;74m\x1B[48;2;7;16;28m│\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m■■■\x1B[38;2;35;57;90m□□□□□□□□□\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m/next /tour hides\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m\x1B[48;2;12;24;40m
|
|
128
|
+
\x1B[48;2;7;16;28m \x1B[38;2;240;190;74m┃\x1B[38;2;255;255;255m\x1B[48;2;18;34;56m \x1B[38;2;240;190;74m\x1B[48;2;7;16;28m╰──────────────────────────────────────────────╯\x1B[38;2;255;255;255m\x1B[48;2;12;24;40m
|
|
129
|
+
\x1B[48;2;7;16;28m \x1B[38;2;240;190;74m┃\x1B[38;2;255;255;255m\x1B[48;2;18;34;56m \x1B[38;2;240;190;74mBuild\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m·\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mscripted\x1B[38;2;255;255;255m \x1B[38;2;135;150;173mGateway\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
130
|
+
\x1B[48;2;7;16;28m \x1B[38;2;240;190;74m╹\x1B[38;2;18;34;56m▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀\x1B[38;2;255;255;255m \x1B[48;2;12;24;40m
|
|
131
|
+
\x1B[48;2;7;16;28m \x1B[38;2;135;150;173m~/tour/code\x1B[38;2;255;255;255m \x1B[48;2;12;24;40m \x1B[38;2;135;150;173m⠴\x1B[38;2;255;255;255m \x1B[38;2;135;150;173mFinishing startup…\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[38;2;135;150;173m15 (0%)\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mctrl+p \x1B[38;2;135;150;173mcommands\x1B[38;2;255;255;255m \x1B[48;2;12;24;40m \x1B[38;2;135;150;173m~/tour/code\x1B[38;2;255;255;255m
|
|
132
|
+
\x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
133
|
+
`},{step:3,title:`More, from your notes`,text:`Press enter. It reads your notes on Barnes–Hut and the quadtree, writes the code, and adds to your note on the goal where the code now is. The code is OpenCode's, as always; what it would change in a note waits for you.`,does:`press enter, and allow the write`,screen:`\x1B[38;2;255;255;255m\x1B[48;2;18;34;56m \x1B[1m\x1B[38;2;233;238;245mTwo bodies, stepped with \x1B[38;2;190;197;207ml\x1B[38;2;138;148;162me\x1B[38;2;87;99;116ma\x1B[38;2;35;50;71mp\x1B[0m\x1B[38;2;135;150;173m\x1B[48;2;7;16;28m + \x1B[38;2;255;255;255m
|
|
134
|
+
\x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m5\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mr = np.array([[-0.5, 0.0], [0.5, 0.0]])\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
135
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m6\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mv = np.array([[0.0, -0.5], [0.0, 0.5]])\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[1m\x1B[38;2;233;238;245mTwo bodies, stepped with leapfrog\x1B[0m\x1B[38;2;255;255;255m\x1B[48;2;12;24;40m
|
|
136
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m7\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mdt, steps = 2 * np.pi / 100, 10_000\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
137
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m8\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[1m\x1B[38;2;233;238;245mContext\x1B[0m\x1B[38;2;255;255;255m\x1B[48;2;12;24;40m
|
|
138
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m9\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;135;150;173m15 tokens\x1B[38;2;255;255;255m
|
|
139
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m10\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mdef accelerations(r, m):\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;135;150;173m0% used\x1B[38;2;255;255;255m
|
|
140
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m11\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m d = r[None, :, :] - r[:, None, :] # d[i, j] = r_j - r_i\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
141
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m12\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m d2 = np.sum(d**2, axis=-1)\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m╭─ notes in play ───────────────────╮\x1B[38;2;255;255;255m
|
|
142
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m13\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m np.fill_diagonal(d2, 1.0)\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m6 found · 2 used\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m
|
|
143
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m14\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m inv = d2**-1.5\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m \x1B[38;2;35;57;90m├─ \x1B[38;2;233;238;245mleapfrog\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m◆ used\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m
|
|
144
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m15\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m np.fill_diagonal(inv, 0.0)\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m \x1B[38;2;35;57;90m├─ \x1B[38;2;233;238;245mchoosing the \x1B[38;2;255;255;255m \x1B[38;2;135;150;173mnot opened\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m
|
|
145
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m16\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m return np.einsum("ij,ijk->ik", m[None, :] * inv, d)\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mtimestep\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m
|
|
146
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m17\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m \x1B[38;2;35;57;90m├─ \x1B[38;2;233;238;245mthe main loop\x1B[38;2;255;255;255m \x1B[38;2;180;192;210mread\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m
|
|
147
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m18\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m \x1B[38;2;35;57;90m├─ \x1B[38;2;233;238;245mdiagnostics\x1B[38;2;255;255;255m \x1B[38;2;135;150;173mnot opened\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m
|
|
148
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m19\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mdef energy(r, v, m):\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m \x1B[38;2;35;57;90m├─ \x1B[38;2;233;238;245msymplectic \x1B[38;2;255;255;255m \x1B[38;2;135;150;173mnot opened\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m
|
|
149
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m20\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m return 0.5 * np.sum(m * np.sum(v**2, axis=1)) - m[0] * m[1] / np.linalg.norm(r[0] - r[1])\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mintegrators\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m
|
|
150
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m21\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m \x1B[38;2;35;57;90m└─ \x1B[38;2;233;238;245minitial conditions\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m◆ used\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m
|
|
151
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m22\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m╰───────────────────────────────────╯\x1B[38;2;255;255;255m
|
|
152
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m23\x1B[38;2;255;255;255m \x1B[38;2;233;238;245ma, e0 = accelerations(r, m), energy(r, v, m)\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
153
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m24\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mfor step in range(steps):\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
154
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m25\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m v += 0.5 * dt * a # kick\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
155
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m26\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m r += dt * v # drift\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
156
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m27\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m a = accelerations(r, m)\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
157
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m28\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m v += 0.5 * dt * a # kick\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
158
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m29\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mprint(f"energy drift after {steps * dt / (2 * np.pi):.0f} orbits: {abs(energy(r, v, m) - e0) / abs(e0):.\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
159
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m1e}")\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
160
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m30\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
161
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
162
|
+
\x1B[48;2;7;16;28m \x1B[38;2;240;190;74m╭─ tour · 4 of 12 ─────────────────────────────╮\x1B[38;2;255;255;255m\x1B[48;2;12;24;40m
|
|
163
|
+
\x1B[48;2;7;16;28m \x1B[38;2;233;238;245msim.py steps the two-body orbit with leapfrog \x1B[38;2;240;190;74m[1]\x1B[38;2;233;238;245m, from the initial conditions in your notes \x1B[38;2;240;190;74m[2]\x1B[38;2;233;238;245m; it prin\x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[1m\x1B[38;2;233;238;245mMore, from your notes\x1B[0m\x1B[38;2;255;255;255m\x1B[48;2;7;16;28m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m\x1B[48;2;12;24;40m
|
|
164
|
+
\x1B[48;2;7;16;28m \x1B[38;2;233;238;245menergy drift, which stays tiny because leapfrog is symplectic.\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;180;192;210mPress enter. It reads your notes on \x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m\x1B[48;2;12;24;40m
|
|
165
|
+
\x1B[48;2;7;16;28m \x1B[38;2;240;190;74m[1]\x1B[38;2;233;238;245m leapfrog\x1B[38;2;135;150;173m § why it does not drift\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;180;192;210mBarnes–Hut and the quadtree, writes the \x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m\x1B[48;2;12;24;40m
|
|
166
|
+
\x1B[48;2;7;16;28m \x1B[38;2;240;190;74m[2]\x1B[38;2;233;238;245m initial conditions\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;180;192;210mcode, and adds to your note on the goal \x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m\x1B[48;2;12;24;40m
|
|
167
|
+
\x1B[48;2;7;16;28m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;180;192;210mwhere the code now is. The code is \x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m\x1B[48;2;12;24;40m
|
|
168
|
+
\x1B[48;2;7;16;28m \x1B[38;2;240;190;74mBuild\x1B[38;2;135;150;173m · scripted · 434ms · 228.8 tok/s\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;180;192;210mOpenCode's, as always; what it would change \x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m\x1B[48;2;12;24;40m
|
|
169
|
+
\x1B[48;2;7;16;28m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;180;192;210min a note waits for you.\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m\x1B[48;2;12;24;40m
|
|
170
|
+
\x1B[48;2;7;16;28m \x1B[38;2;240;190;74m┃\x1B[38;2;255;255;255m\x1B[48;2;18;34;56m \x1B[38;2;240;190;74m\x1B[48;2;7;16;28m│\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m\x1B[48;2;12;24;40m
|
|
171
|
+
\x1B[48;2;7;16;28m \x1B[38;2;240;190;74m┃\x1B[38;2;255;255;255m\x1B[48;2;18;34;56m \x1B[38;2;233;238;245madd Barnes–Hut to the code, as my notes describe it, and note where it is\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m\x1B[48;2;7;16;28m│\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m■■■■\x1B[38;2;35;57;90m□□□□□□□□\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m/tour hides\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m\x1B[48;2;12;24;40m
|
|
172
|
+
\x1B[48;2;7;16;28m \x1B[38;2;240;190;74m┃\x1B[38;2;255;255;255m\x1B[48;2;18;34;56m \x1B[38;2;240;190;74m\x1B[48;2;7;16;28m╰──────────────────────────────────────────────╯\x1B[38;2;255;255;255m\x1B[48;2;12;24;40m
|
|
173
|
+
\x1B[48;2;7;16;28m \x1B[38;2;240;190;74m┃\x1B[38;2;255;255;255m\x1B[48;2;18;34;56m \x1B[38;2;240;190;74mBuild\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m·\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mscripted\x1B[38;2;255;255;255m \x1B[38;2;135;150;173mGateway\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
174
|
+
\x1B[48;2;7;16;28m \x1B[38;2;240;190;74m╹\x1B[38;2;18;34;56m▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀\x1B[38;2;255;255;255m \x1B[48;2;12;24;40m
|
|
175
|
+
\x1B[48;2;7;16;28m \x1B[38;2;135;150;173m~/tour/code\x1B[38;2;255;255;255m \x1B[48;2;12;24;40m \x1B[38;2;135;150;173m⠸\x1B[38;2;255;255;255m \x1B[38;2;135;150;173mFinishing startup…\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[38;2;135;150;173m15 (0%)\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mctrl+p \x1B[38;2;135;150;173mcommands\x1B[38;2;255;255;255m \x1B[48;2;12;24;40m \x1B[38;2;135;150;173m~/tour/code\x1B[38;2;255;255;255m
|
|
176
|
+
\x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
177
|
+
`},{step:4,title:`isorite's tools`,text:`What it used are isorite's: brief_base, search_notes, find_similar, outline_note and read_note to look, propose_note_edit and propose_note_write to suggest. And two commands: /atlas and /note. Type /next.`,does:`type /next`,screen:`\x1B[48;2;26;41;63m \x1B[48;2;26;42;63m \x1B[1m\x1B[38;2;233;238;245mT\x1B[48;2;26;41;63mw\x1B[48;2;24;40;62mo\x1B[48;2;22;37;59m \x1B[48;2;20;36;58mbodies, stepped with \x1B[38;2;190;197;207ml\x1B[38;2;138;148;162me\x1B[38;2;87;99;116ma\x1B[38;2;35;50;71mp\x1B[0m\x1B[38;2;135;150;173m\x1B[48;2;7;16;28m + \x1B[38;2;255;255;255m
|
|
178
|
+
\x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m26\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
179
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m27\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m def child(self, p):\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[1m\x1B[38;2;233;238;245mTwo bodies, stepped with leapfrog\x1B[0m\x1B[38;2;255;255;255m\x1B[48;2;12;24;40m
|
|
180
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m28\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m return self.children[2 * (p[0] > self.centre[0]) + (p[1] > self.centre[1])]\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
181
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m29\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[1m\x1B[38;2;233;238;245mContext\x1B[0m\x1B[38;2;255;255;255m\x1B[48;2;12;24;40m
|
|
182
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m30\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m def pull(self, p, eps):\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;135;150;173m15 tokens\x1B[38;2;255;255;255m
|
|
183
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m31\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m """The acceleration this node gives a body at p: whole if it is far enough (s/d < θ), else opened.\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;135;150;173m0% used\x1B[38;2;255;255;255m
|
|
184
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m"""\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
185
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m32\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m if self.mass == 0 or (self.body is not None and np.allclose(self.com, p)):\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m╭─ notes in play ───────────────────╮\x1B[38;2;255;255;255m
|
|
186
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m33\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m return np.zeros(2)\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m7 found · 1 by links · 3 used\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m
|
|
187
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m34\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m d = self.com - p\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m \x1B[38;2;35;57;90m├─ \x1B[38;2;233;238;245mleapfrog\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m◆ used\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m
|
|
188
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m35\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m dist = np.sqrt(d @ d + eps**2)\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m \x1B[38;2;35;57;90m├─ \x1B[38;2;233;238;245mchoosing the \x1B[38;2;255;255;255m \x1B[38;2;135;150;173mnot opened\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m
|
|
189
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m36\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m if self.children is None or self.side / dist < THETA:\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mtimestep\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m
|
|
190
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m37\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m return self.mass * d / dist**3\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m \x1B[38;2;35;57;90m├─ \x1B[38;2;233;238;245mthe main loop\x1B[38;2;255;255;255m \x1B[38;2;180;192;210mread\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m
|
|
191
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m38\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m return sum(c.pull(p, eps) for c in self.children)\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m \x1B[38;2;35;57;90m├─ \x1B[38;2;233;238;245mdiagnostics\x1B[38;2;255;255;255m \x1B[38;2;135;150;173mnot opened\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m
|
|
192
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m39\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m \x1B[38;2;35;57;90m├─ \x1B[38;2;233;238;245msymplectic \x1B[38;2;255;255;255m \x1B[38;2;135;150;173mnot opened\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m
|
|
193
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m40\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mintegrators\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m
|
|
194
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m41\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mdef accelerations(r, m, eps=0.01):\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m \x1B[38;2;35;57;90m├─ \x1B[38;2;233;238;245minitial conditions\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m◆ used\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m
|
|
195
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m42\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m lo, hi = r.min(axis=0), r.max(axis=0)\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m \x1B[38;2;35;57;90m└─ \x1B[38;2;233;238;245mbarnes–hut\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m◆ used\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m
|
|
196
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m43\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m root = Node((lo + hi) / 2, max(hi - lo) * 1.001)\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m \x1B[38;2;35;57;90m └─ \x1B[38;2;233;238;245mrequires › the \x1B[38;2;255;255;255m \x1B[38;2;180;192;210mread\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m
|
|
197
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m44\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m for i in range(len(m)):\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mquadtree\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m
|
|
198
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m45\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m root.insert(i, r, m)\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m╰───────────────────────────────────╯\x1B[38;2;255;255;255m
|
|
199
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m46\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m return np.array([root.pull(p, eps) for p in r])\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
200
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m47\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
201
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
202
|
+
\x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
203
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
204
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m← Edit\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m~/tour/base/nbody-notes/simulation/two-galaxies-colliding.md\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
205
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
206
|
+
\x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
207
|
+
\x1B[48;2;7;16;28m \x1B[38;2;233;238;245mbarnes_hut.py builds the quadtree and walks it with θ = 0.5 \x1B[38;2;240;190;74m[1]\x1B[38;2;233;238;245m. Your note on the goal now says where the\x1B[38;2;240;190;74m╭─ tour · 5 of 12 ─────────────────────────────╮\x1B[38;2;255;255;255m\x1B[48;2;12;24;40m
|
|
208
|
+
\x1B[48;2;7;16;28m \x1B[38;2;233;238;245mis: that change waits for you to keep or not \x1B[38;2;240;190;74m[2]\x1B[38;2;233;238;245m.\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[1m\x1B[38;2;233;238;245misorite's tools\x1B[0m\x1B[38;2;255;255;255m\x1B[48;2;7;16;28m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m\x1B[48;2;12;24;40m
|
|
209
|
+
\x1B[48;2;7;16;28m \x1B[38;2;240;190;74m[1]\x1B[38;2;233;238;245m barnes–hut\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;180;192;210mWhat it used are isorite's: brief_base, \x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m\x1B[48;2;12;24;40m
|
|
210
|
+
\x1B[48;2;7;16;28m \x1B[38;2;240;190;74m[2]\x1B[38;2;233;238;245m two galaxies colliding\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;180;192;210msearch_notes, find_similar, outline_note and\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m\x1B[48;2;12;24;40m
|
|
211
|
+
\x1B[48;2;7;16;28m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;180;192;210mread_note to look, propose_note_edit and \x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m\x1B[48;2;12;24;40m
|
|
212
|
+
\x1B[48;2;7;16;28m \x1B[38;2;240;190;74mBuild\x1B[38;2;135;150;173m · scripted · 292ms · 255.1 tok/s\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;180;192;210mpropose_note_write to suggest. And two \x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m\x1B[48;2;12;24;40m
|
|
213
|
+
\x1B[48;2;7;16;28m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;180;192;210mcommands: /atlas and /note. Type /next.\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m\x1B[48;2;12;24;40m
|
|
214
|
+
\x1B[48;2;7;16;28m \x1B[38;2;240;190;74m┃\x1B[38;2;255;255;255m\x1B[48;2;18;34;56m \x1B[38;2;240;190;74m\x1B[48;2;7;16;28m│\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m\x1B[48;2;12;24;40m
|
|
215
|
+
\x1B[48;2;7;16;28m \x1B[38;2;240;190;74m┃\x1B[38;2;255;255;255m\x1B[48;2;18;34;56m \x1B[38;2;240;190;74m\x1B[48;2;7;16;28m│\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m■■■■■\x1B[38;2;35;57;90m□□□□□□□\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m/next /tour hides\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m\x1B[48;2;12;24;40m
|
|
216
|
+
\x1B[48;2;7;16;28m \x1B[38;2;240;190;74m┃\x1B[38;2;255;255;255m\x1B[48;2;18;34;56m \x1B[38;2;240;190;74m\x1B[48;2;7;16;28m╰──────────────────────────────────────────────╯\x1B[38;2;255;255;255m\x1B[48;2;12;24;40m
|
|
217
|
+
\x1B[48;2;7;16;28m \x1B[38;2;240;190;74m┃\x1B[38;2;255;255;255m\x1B[48;2;18;34;56m \x1B[38;2;240;190;74mBuild\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m·\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mscripted\x1B[38;2;255;255;255m \x1B[38;2;135;150;173mGateway\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
218
|
+
\x1B[48;2;7;16;28m \x1B[38;2;240;190;74m╹\x1B[38;2;18;34;56m▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀\x1B[38;2;255;255;255m \x1B[48;2;12;24;40m
|
|
219
|
+
\x1B[48;2;7;16;28m \x1B[38;2;135;150;173m~/tour/code\x1B[38;2;255;255;255m \x1B[48;2;12;24;40m \x1B[38;2;135;150;173m⠋\x1B[38;2;255;255;255m \x1B[38;2;135;150;173mFinishing startup…\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[38;2;135;150;173m15 (0%)\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mctrl+p \x1B[38;2;135;150;173mcommands\x1B[38;2;255;255;255m \x1B[48;2;12;24;40m \x1B[38;2;135;150;173m~/tour/code\x1B[38;2;255;255;255m
|
|
220
|
+
\x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
221
|
+
`},{step:5,title:`One note's atlas`,text:`Type /atlas barnes hut. Beside the chat: what the note requires, on the left, and what builds on it, on the right.`,does:`type /atlas barnes hut`,screen:`\x1B[38;2;255;255;255m\x1B[48;2;18;34;56m \x1B[1m\x1B[38;2;233;238;245mTwo bodies, stepped with \x1B[38;2;190;197;207ml\x1B[38;2;138;148;162me\x1B[38;2;87;99;116ma\x1B[38;2;35;50;71mp\x1B[0m\x1B[38;2;135;150;173m\x1B[48;2;7;16;28m + \x1B[38;2;255;255;255m
|
|
222
|
+
\x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m26\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
223
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m27\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m def child(self, p):\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[1m\x1B[38;2;233;238;245mTwo bodies, stepped with leapfrog\x1B[0m\x1B[38;2;255;255;255m\x1B[48;2;12;24;40m
|
|
224
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m28\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m return self.children[2 * (p[0] > self.centre[0]) + (p[1] > self.centre[1])]\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
225
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m29\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[1m\x1B[38;2;233;238;245mContext\x1B[0m\x1B[38;2;255;255;255m\x1B[48;2;12;24;40m
|
|
226
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m30\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m def pull(self, p, eps):\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;135;150;173m15 tokens\x1B[38;2;255;255;255m
|
|
227
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m31\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m """The acceleration this node gives a body at p: whole if it is far enough (s/d < θ), else opened.\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;135;150;173m0% used\x1B[38;2;255;255;255m
|
|
228
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m"""\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
229
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m32\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m if self.mass == 0 or (self.body is not None and np.allclose(self.com, p)):\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m╭─ notes in play ───────────────────╮\x1B[38;2;255;255;255m
|
|
230
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m33\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m return np.zeros(2)\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m7 found · 1 by links · 3 used\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m
|
|
231
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m34\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m d = self.com - p\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m \x1B[38;2;35;57;90m├─ \x1B[38;2;233;238;245mleapfrog\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m◆ used\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m
|
|
232
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m35\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m dist = np.sqrt(d @ d + eps**2)\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m \x1B[38;2;35;57;90m├─ \x1B[38;2;233;238;245mchoosing the \x1B[38;2;255;255;255m \x1B[38;2;135;150;173mnot opened\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m
|
|
233
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m36\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m if self.children is None or self.side / dist < THETA:\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mtimestep\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m
|
|
234
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m37\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m return self.mass * d / dist**3\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m \x1B[38;2;35;57;90m├─ \x1B[38;2;233;238;245mthe main loop\x1B[38;2;255;255;255m \x1B[38;2;180;192;210mread\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m
|
|
235
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m38\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m return sum(c.pull(p, eps) for c in self.children)\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m \x1B[38;2;35;57;90m├─ \x1B[38;2;233;238;245mdiagnostics\x1B[38;2;255;255;255m \x1B[38;2;135;150;173mnot opened\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m
|
|
236
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m39\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m \x1B[38;2;35;57;90m├─ \x1B[38;2;233;238;245msymplectic \x1B[38;2;255;255;255m \x1B[38;2;135;150;173mnot opened\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m
|
|
237
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m40\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mintegrators\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m
|
|
238
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m41\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mdef accelerations(r, m, eps=0.01):\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m \x1B[38;2;35;57;90m├─ \x1B[38;2;233;238;245minitial conditions\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m◆ used\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m
|
|
239
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m42\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m lo, hi = r.min(axis=0), r.max(axis=0)\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m \x1B[38;2;35;57;90m└─ \x1B[38;2;233;238;245mbarnes–hut\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m◆ used\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m
|
|
240
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m43\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m root = Node((lo + hi) / 2, max(hi - lo) * 1.001)\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m \x1B[38;2;35;57;90m └─ \x1B[38;2;233;238;245mrequires › the \x1B[38;2;255;255;255m \x1B[38;2;180;192;210mread\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m
|
|
241
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m44\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m for i in range(len(m)):\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mquadtree\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m│\x1B[38;2;255;255;255m
|
|
242
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m45\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m root.insert(i, r, m)\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m \x1B[38;2;92;123;166m╰───────────────────────────────────╯\x1B[38;2;255;255;255m
|
|
243
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m46\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m return np.array([root.pull(p, eps) for p in r])\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
244
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m47\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
245
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
246
|
+
\x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
247
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
248
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m← Edit\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m~/tour/base/nbody-notes/simulation/two-galaxies-colliding.md\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
249
|
+
\x1B[48;2;7;16;28m \x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
250
|
+
\x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
251
|
+
\x1B[48;2;7;16;28m \x1B[38;2;233;238;245mbarnes_hut.py builds the quadtree and walks it with θ = 0.5 \x1B[38;2;240;190;74m[1]\x1B[38;2;233;238;245m. Your note on the goal now says where the code \x1B[38;2;255;255;255m \x1B[48;2;12;24;40m
|
|
252
|
+
\x1B[48;2;7;16;28m \x1B[38;2;233;238;245mis: that change waits for you to keep or not \x1B[38;2;240;190;74m[2]\x1B[38;2;233;238;245m.\x1B[38;2;255;255;255m \x1B[48;2;12;24;40m
|
|
253
|
+
\x1B[48;2;7;16;28m \x1B[38;2;240;190;74m[1]\x1B[38;2;233;238;245m barnes–hut\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m╭─ tour · 6 of 12 ─────────────────────────────╮\x1B[38;2;255;255;255m\x1B[48;2;12;24;40m
|
|
254
|
+
\x1B[48;2;7;16;28m \x1B[38;2;240;190;74m[2]\x1B[38;2;233;238;245m two galaxies colliding\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[1m\x1B[38;2;233;238;245mOne note's atlas\x1B[0m\x1B[38;2;255;255;255m\x1B[48;2;7;16;28m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m\x1B[48;2;12;24;40m
|
|
255
|
+
\x1B[48;2;7;16;28m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;180;192;210mType /atlas barnes hut. Beside the chat: \x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m\x1B[48;2;12;24;40m
|
|
256
|
+
\x1B[48;2;7;16;28m \x1B[38;2;240;190;74mBuild\x1B[38;2;135;150;173m · scripted · 292ms · 255.1 tok/s\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;180;192;210mwhat the note requires, on the left, and \x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m\x1B[48;2;12;24;40m
|
|
257
|
+
\x1B[48;2;7;16;28m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;180;192;210mwhat builds on it, on the right.\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m\x1B[48;2;12;24;40m
|
|
258
|
+
\x1B[48;2;7;16;28m \x1B[38;2;240;190;74m┃\x1B[38;2;255;255;255m\x1B[48;2;18;34;56m \x1B[38;2;240;190;74m\x1B[48;2;7;16;28m│\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m\x1B[48;2;12;24;40m
|
|
259
|
+
\x1B[48;2;7;16;28m \x1B[38;2;240;190;74m┃\x1B[38;2;255;255;255m\x1B[48;2;18;34;56m \x1B[38;2;240;190;74m\x1B[48;2;7;16;28m│\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m■■■■■■\x1B[38;2;35;57;90m□□□□□□\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m/tour hides\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m\x1B[48;2;12;24;40m
|
|
260
|
+
\x1B[48;2;7;16;28m \x1B[38;2;240;190;74m┃\x1B[38;2;255;255;255m\x1B[48;2;18;34;56m \x1B[38;2;240;190;74m\x1B[48;2;7;16;28m╰──────────────────────────────────────────────╯\x1B[38;2;255;255;255m\x1B[48;2;12;24;40m
|
|
261
|
+
\x1B[48;2;7;16;28m \x1B[38;2;240;190;74m┃\x1B[38;2;255;255;255m\x1B[48;2;18;34;56m \x1B[38;2;240;190;74mBuild\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m·\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mscripted\x1B[38;2;255;255;255m \x1B[38;2;135;150;173mGateway\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
262
|
+
\x1B[48;2;7;16;28m \x1B[38;2;240;190;74m╹\x1B[38;2;18;34;56m▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀\x1B[38;2;255;255;255m \x1B[48;2;12;24;40m
|
|
263
|
+
\x1B[48;2;7;16;28m \x1B[38;2;135;150;173m~/tour/code\x1B[38;2;255;255;255m \x1B[38;2;135;150;173mnbody-notes\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m15 (0%)\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mctrl+p \x1B[38;2;135;150;173mcommands\x1B[38;2;255;255;255m \x1B[48;2;12;24;40m \x1B[38;2;135;150;173m~/tour/code\x1B[38;2;255;255;255m
|
|
264
|
+
\x1B[48;2;7;16;28m \x1B[48;2;12;24;40m
|
|
265
|
+
`},{step:6,title:`Open the note`,text:`Type /note two galaxies. A note in the terminal: who wrote each paragraph in the gutter, maths as source, links underlined.`,does:`type /note two galaxies`,screen:`\x1B[38;2;255;255;255m\x1B[48;2;18;34;56m \x1B[1m\x1B[38;2;233;238;245mTwo bodies, stepped with \x1B[38;2;190;197;207ml\x1B[38;2;138;148;162me\x1B[38;2;87;99;116ma\x1B[38;2;35;50;71mp\x1B[0m\x1B[38;2;135;150;173m\x1B[48;2;7;16;28m + \x1B[38;2;255;255;255m
|
|
266
|
+
\x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mself.centre[1])]\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m
|
|
267
|
+
\x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m29\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;135;150;173matlas · \x1B[38;2;233;238;245mbarnes–hut\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m[a] next note in play\x1B[38;2;255;255;255m
|
|
268
|
+
\x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m30\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m def pull(self, p, eps):\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m
|
|
269
|
+
\x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m31\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m """The acceleration this node gives a body at p: whole if it\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;183;156;255mit requires\x1B[38;2;255;255;255m \x1B[38;2;255;158;100mbuilds on it\x1B[38;2;255;255;255m
|
|
270
|
+
\x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mis far enough (s/d < θ), else opened."""\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m┌───────────────────┐\x1B[38;2;233;238;245m \x1B[38;2;255;255;255m
|
|
271
|
+
\x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m32\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m if self.mass == 0 or (self.body is not None and np.allclose(\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m│\x1B[38;2;233;238;245m the quadtree \x1B[38;2;92;123;166m│\x1B[38;2;183;156;255m──┐\x1B[38;2;233;238;245m \x1B[38;2;255;255;255m
|
|
272
|
+
\x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mself.com, p)):\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m│\x1B[38;2;233;238;245m \x1B[38;2;92;123;166m│\x1B[38;2;233;238;245m \x1B[38;2;183;156;255m│\x1B[38;2;233;238;245m ┏━━━━━━━━━━━━━━━━━━━┓ \x1B[38;2;92;123;166m┌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┐\x1B[38;2;255;255;255m
|
|
273
|
+
\x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m33\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m return np.zeros(2)\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m└───────────────────┘\x1B[38;2;233;238;245m \x1B[38;2;183;156;255m├──\x1B[38;2;233;238;245m┃ barnes–hut ┃\x1B[38;2;255;158;100m─────\x1B[38;2;92;123;166m╎\x1B[38;2;233;238;245m cost and accuracy \x1B[38;2;92;123;166m╎\x1B[38;2;255;255;255m
|
|
274
|
+
\x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m34\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m d = self.com - p\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m \x1B[38;2;183;156;255m│\x1B[38;2;233;238;245m ┃ ┃ \x1B[38;2;92;123;166m╎\x1B[38;2;233;238;245m \x1B[38;2;92;123;166m╎\x1B[38;2;255;255;255m
|
|
275
|
+
\x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m35\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m dist = np.sqrt(d @ d + eps**2)\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m┌───────────────────┐\x1B[38;2;233;238;245m \x1B[38;2;183;156;255m│\x1B[38;2;233;238;245m ┗━━━━━━━━━━━━━━━━━━━┛ \x1B[38;2;92;123;166m└╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┘\x1B[38;2;255;255;255m
|
|
276
|
+
\x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m36\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m if self.children is None or self.side / dist < THETA:\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m│\x1B[38;2;233;238;245m centre of mass \x1B[38;2;92;123;166m│\x1B[38;2;183;156;255m──┘\x1B[38;2;233;238;245m \x1B[38;2;255;255;255m
|
|
277
|
+
\x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m37\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m return self.mass * d / dist**3\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m│\x1B[38;2;233;238;245m \x1B[38;2;92;123;166m│\x1B[38;2;233;238;245m \x1B[38;2;255;255;255m
|
|
278
|
+
\x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m38\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m return sum(c.pull(p, eps) for c in self.children)\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;92;123;166m└───────────────────┘\x1B[38;2;233;238;245m \x1B[38;2;255;255;255m
|
|
279
|
+
\x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m39\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m
|
|
280
|
+
\x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m40\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m[b] the whole map in the browser\x1B[38;2;255;255;255m
|
|
281
|
+
\x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m41\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mdef accelerations(r, m, eps=0.01):\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m
|
|
282
|
+
\x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m42\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m lo, hi = r.min(axis=0), r.max(axis=0)\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m
|
|
283
|
+
\x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m43\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m root = Node((lo + hi) / 2, max(hi - lo) * 1.001)\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m
|
|
284
|
+
\x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m44\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m for i in range(len(m)):\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m
|
|
285
|
+
\x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m45\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m root.insert(i, r, m)\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m
|
|
286
|
+
\x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m46\x1B[38;2;255;255;255m \x1B[38;2;233;238;245m return np.array([root.pull(p, eps) for p in r])\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m
|
|
287
|
+
\x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m47\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m
|
|
288
|
+
\x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m
|
|
289
|
+
\x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m
|
|
290
|
+
\x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m
|
|
291
|
+
\x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m← Edit\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m~/tour/base/nbody-notes/simulation/two-galaxies-colliding.md\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m
|
|
292
|
+
\x1B[38;2;7;16;28m\x1B[48;2;12;24;40m┃\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m
|
|
293
|
+
\x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m
|
|
294
|
+
\x1B[38;2;233;238;245mbarnes_hut.py builds the quadtree and walks it with θ = 0.5 \x1B[38;2;240;190;74m[1]\x1B[38;2;233;238;245m. Your \x1B[38;2;255;255;255m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m
|
|
295
|
+
\x1B[38;2;233;238;245mnote on the goal now says where the code is: that change waits for you to\x1B[38;2;255;255;255m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m
|
|
296
|
+
\x1B[38;2;233;238;245mkeep or not \x1B[38;2;240;190;74m[2]\x1B[38;2;233;238;245m.\x1B[38;2;255;255;255m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m
|
|
297
|
+
\x1B[38;2;240;190;74m[1]\x1B[38;2;233;238;245m barnes–hut\x1B[38;2;255;255;255m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m╭─ tour · 7 of 12 ─────────────────────────────╮\x1B[38;2;255;255;255m
|
|
298
|
+
\x1B[38;2;240;190;74m[2]\x1B[38;2;233;238;245m two galaxies colliding\x1B[38;2;255;255;255m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[1m\x1B[38;2;233;238;245mOpen the note\x1B[0m\x1B[38;2;255;255;255m\x1B[48;2;7;16;28m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
299
|
+
\x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;180;192;210mType /note two galaxies. A note in the \x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
300
|
+
\x1B[38;2;240;190;74mBuild\x1B[38;2;135;150;173m · scripted · 292ms · 255.1 tok/s\x1B[38;2;255;255;255m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;180;192;210mterminal: who wrote each paragraph in the \x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
301
|
+
\x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;180;192;210mgutter, maths as source, links underlined.\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
302
|
+
\x1B[38;2;240;190;74m┃\x1B[38;2;255;255;255m\x1B[48;2;18;34;56m \x1B[48;2;7;16;28m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
303
|
+
\x1B[38;2;240;190;74m┃\x1B[38;2;255;255;255m\x1B[48;2;18;34;56m \x1B[48;2;7;16;28m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m■■■■■■■\x1B[38;2;35;57;90m□□□□□\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m/tour hides\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
304
|
+
\x1B[38;2;240;190;74m┃\x1B[38;2;255;255;255m\x1B[48;2;18;34;56m \x1B[48;2;7;16;28m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m╰──────────────────────────────────────────────╯\x1B[38;2;255;255;255m
|
|
305
|
+
\x1B[38;2;240;190;74m┃\x1B[38;2;255;255;255m\x1B[48;2;18;34;56m \x1B[38;2;240;190;74mBuild\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m·\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mscripted\x1B[38;2;255;255;255m \x1B[38;2;135;150;173mGateway\x1B[38;2;255;255;255m \x1B[48;2;7;16;28m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m
|
|
306
|
+
\x1B[38;2;240;190;74m╹\x1B[38;2;18;34;56m▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀\x1B[38;2;255;255;255m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m
|
|
307
|
+
\x1B[38;2;135;150;173m~/tour/code\x1B[38;2;255;255;255m \x1B[38;2;135;150;173mnbody-notes\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m15 (0%)\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mctrl+p \x1B[38;2;135;150;173mcommands\x1B[38;2;255;255;255m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m
|
|
308
|
+
\x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m
|
|
309
|
+
`},{step:7,title:`Keep it, or not`,text:`The agent's change waits between dotted lines. [k] keeps it, [e] edits it first, [r] removes it; [n] goes to the next.`,does:`press k`,screen:`\x1B[38;2;255;255;255m\x1B[48;2;7;16;28m
|
|
310
|
+
\x1B[38;2;233;238;245msimulation / two galaxies colliding\x1B[38;2;255;255;255m \x1B[38;2;180;192;210mnot reached \x1B[38;2;35;57;90m□□□□□□\x1B[38;2;255;255;255m
|
|
311
|
+
|
|
312
|
+
\x1B[38;2;107;166;255m ■ │\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mTwo \x1B[38;2;107;166;255mPlummer spheres\x1B[38;2;233;238;245m of 1000 bodies each, set on a parabolic approach and \x1B[38;2;255;255;255m
|
|
313
|
+
\x1B[38;2;107;166;255m│\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mstepped with \x1B[38;2;107;166;255mthe main loop\x1B[38;2;233;238;245m. After the first pass, long tails of stars are \x1B[38;2;255;255;255m
|
|
314
|
+
\x1B[38;2;107;166;255m│\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mpulled out of each: the tidal tails that are seen in the sky.\x1B[38;2;255;255;255m
|
|
315
|
+
\x1B[38;2;135;150;173m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m
|
|
316
|
+
\x1B[38;2;107;166;255m ■ \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mAt $N = 2000$ direct summation is slow but bearable. The tails are thin at \x1B[38;2;255;255;255m
|
|
317
|
+
\x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mthat resolution, and $N = 5000$ is where it starts to look right, but there \x1B[38;2;255;255;255m
|
|
318
|
+
\x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mdirect summation takes too long for an evening's run. That is what \x1B[38;2;107;166;255mBarnes–Hut\x1B[38;2;255;255;255m
|
|
319
|
+
\x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mis for.\x1B[38;2;255;255;255m
|
|
320
|
+
\x1B[38;2;135;150;173m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m
|
|
321
|
+
\x1B[38;2;240;190;74m ◇ \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · ·\x1B[38;2;255;255;255m
|
|
322
|
+
\x1B[38;2;135;150;173m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[9m\x1B[38;2;135;150;173mThat is what [Barnes–Hut](/algorithms/barnes-hut.md "uses") is for.\x1B[0m\x1B[38;2;255;255;255m\x1B[48;2;7;16;28m
|
|
323
|
+
\x1B[38;2;135;150;173m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mThat is what \x1B[38;2;107;166;255mBarnes–Hut\x1B[38;2;233;238;245m is for: \`barnes_hut.py\` has it, at θ = 0.5.\x1B[38;2;255;255;255m
|
|
324
|
+
\x1B[38;2;135;150;173m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m◆ OpenCode\x1B[38;2;135;150;173m · not kept yet \x1B[38;2;95;211;164m[k] keep \x1B[38;2;240;190;74m[e] edit \x1B[38;2;255;143;166m[r] remove\x1B[38;2;255;255;255m
|
|
325
|
+
\x1B[38;2;135;150;173m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m“add Barnes–Hut to the code, as my notes describe it, and note where it is”\x1B[38;2;255;255;255m
|
|
326
|
+
\x1B[38;2;240;190;74m ◇ \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · ·\x1B[38;2;255;255;255m
|
|
327
|
+
\x1B[38;2;135;150;173m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
\x1B[38;2;240;190;74m╭─ tour · 8 of 12 ─────────────────────────────╮\x1B[38;2;255;255;255m
|
|
342
|
+
\x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[1m\x1B[38;2;233;238;245mKeep it, or not\x1B[0m\x1B[38;2;255;255;255m\x1B[48;2;7;16;28m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
343
|
+
\x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;180;192;210mThe agent's change waits between dotted \x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
344
|
+
\x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;180;192;210mlines. [k] keeps it, [e] edits it first, [r]\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
345
|
+
\x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;180;192;210mremoves it; [n] goes to the next.\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
346
|
+
\x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
347
|
+
\x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m■■■■■■■■\x1B[38;2;35;57;90m□□□□\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m/tour hides\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
348
|
+
\x1B[38;2;240;190;74m╰──────────────────────────────────────────────╯\x1B[38;2;255;255;255m
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
\x1B[48;2;12;24;40m \x1B[38;2;7;16;28m\x1B[48;2;233;238;245m note \x1B[38;2;255;255;255m\x1B[48;2;12;24;40m \x1B[38;2;135;150;173mnbody-notes\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m[n] next change\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m[t] timeline\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m[/] ask in place\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m[a] its atlas\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m[s] send to agent\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m[b] browser\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m[q] back\x1B[38;2;255;255;255m
|
|
353
|
+
`},{step:8,title:`Ask Iso here`,text:`↑ and ↓ choose a paragraph; [/] asks Iso, isorite's own agent, to write after it. Its answer waits for you the same way.`,does:`press /, ask, press enter`,screen:`\x1B[38;2;255;255;255m\x1B[48;2;7;16;28m
|
|
354
|
+
\x1B[38;2;233;238;245msimulation / two galaxies colliding\x1B[38;2;255;255;255m \x1B[38;2;180;192;210mnot reached \x1B[38;2;35;57;90m□□□□□□\x1B[38;2;255;255;255m
|
|
355
|
+
|
|
356
|
+
\x1B[38;2;107;166;255m ■ │\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mTwo \x1B[38;2;107;166;255mPlummer spheres\x1B[38;2;233;238;245m of 1000 bodies each, set on a parabolic approach and \x1B[38;2;255;255;255m
|
|
357
|
+
\x1B[38;2;107;166;255m│\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mstepped with \x1B[38;2;107;166;255mthe main loop\x1B[38;2;233;238;245m. After the first pass, long tails of stars are \x1B[38;2;255;255;255m
|
|
358
|
+
\x1B[38;2;107;166;255m│\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mpulled out of each: the tidal tails that are seen in the sky.\x1B[38;2;255;255;255m
|
|
359
|
+
\x1B[38;2;135;150;173m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m
|
|
360
|
+
\x1B[38;2;135;150;173m ◆ \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mAt $N = 2000$ direct summation is slow but bearable. The tails are thin at \x1B[38;2;255;255;255m
|
|
361
|
+
\x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mthat resolution, and $N = 5000$ is where it starts to look right, but there \x1B[38;2;255;255;255m
|
|
362
|
+
\x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mdirect summation takes too long for an evening's run. That is what \x1B[38;2;107;166;255mBarnes–Hut\x1B[38;2;255;255;255m
|
|
363
|
+
\x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mis for: \`barnes_hut.py\` has it, at θ = 0.5.\x1B[38;2;255;255;255m
|
|
364
|
+
\x1B[38;2;135;150;173m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
\x1B[38;2;240;190;74m╭─ tour · 9 of 12 ─────────────────────────────╮\x1B[38;2;255;255;255m
|
|
386
|
+
\x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[1m\x1B[38;2;233;238;245mAsk Iso here\x1B[0m\x1B[38;2;255;255;255m\x1B[48;2;7;16;28m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
387
|
+
\x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;180;192;210m↑ and ↓ choose a paragraph; [/] asks Iso, \x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
388
|
+
\x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;180;192;210misorite's own agent, to write after it. Its \x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
389
|
+
\x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;180;192;210manswer waits for you the same way.\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
390
|
+
\x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
391
|
+
\x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m■■■■■■■■■\x1B[38;2;35;57;90m□□□\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m/tour hides\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
392
|
+
\x1B[38;2;240;190;74m╰──────────────────────────────────────────────╯\x1B[38;2;255;255;255m
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
|
|
396
|
+
\x1B[48;2;12;24;40m \x1B[38;2;7;16;28m\x1B[48;2;233;238;245m note \x1B[38;2;255;255;255m\x1B[48;2;12;24;40m \x1B[38;2;135;150;173mnbody-notes\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m[t] timeline\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m[/] ask in place\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m[a] its atlas\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m[s] send to agent\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m[b] browser\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m[q] back\x1B[38;2;255;255;255m
|
|
397
|
+
`},{step:9,title:`Every change is kept`,text:`[t] lists the note's history. Choose a moment to see the note as it was then; [q] comes back to now.`,does:`press t, choose a moment`,screen:`\x1B[38;2;255;255;255m\x1B[48;2;7;16;28m
|
|
398
|
+
\x1B[38;2;233;238;245msimulation / two galaxies colliding\x1B[38;2;255;255;255m \x1B[38;2;180;192;210mnot reached \x1B[38;2;35;57;90m□□□□□□\x1B[38;2;255;255;255m
|
|
399
|
+
|
|
400
|
+
\x1B[38;2;107;166;255m ■ │\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mTwo \x1B[38;2;107;166;255mPlummer spheres\x1B[38;2;233;238;245m of 1000 bodies each, set on a parabolic approach and \x1B[38;2;255;255;255m
|
|
401
|
+
\x1B[38;2;107;166;255m│\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mstepped with \x1B[38;2;107;166;255mthe main loop\x1B[38;2;233;238;245m. After the first pass, long tails of stars are \x1B[38;2;255;255;255m
|
|
402
|
+
\x1B[38;2;107;166;255m│\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mpulled out of each: the tidal tails that are seen in the sky.\x1B[38;2;255;255;255m
|
|
403
|
+
\x1B[38;2;135;150;173m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m
|
|
404
|
+
\x1B[38;2;240;190;74m ◇ \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · ·\x1B[38;2;255;255;255m
|
|
405
|
+
\x1B[38;2;135;150;173m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mIn 3D the same tree has eight children a node: an octree.\x1B[38;2;255;255;255m
|
|
406
|
+
\x1B[38;2;135;150;173m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m◆ Iso\x1B[38;2;135;150;173m · not kept yet \x1B[38;2;95;211;164m[k] keep \x1B[38;2;240;190;74m[e] edit \x1B[38;2;255;143;166m[r] remove\x1B[38;2;255;255;255m
|
|
407
|
+
\x1B[38;2;135;150;173m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m“say what changes in 3D”\x1B[38;2;255;255;255m
|
|
408
|
+
\x1B[38;2;240;190;74m ◇ \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · ·\x1B[38;2;255;255;255m
|
|
409
|
+
\x1B[38;2;135;150;173m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m
|
|
410
|
+
\x1B[38;2;135;150;173m ◆ \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mAt $N = 2000$ direct summation is slow but bearable. The tails are thin at \x1B[38;2;255;255;255m
|
|
411
|
+
\x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mthat resolution, and $N = 5000$ is where it starts to look right, but there \x1B[38;2;255;255;255m
|
|
412
|
+
\x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mdirect summation takes too long for an evening's run. That is what \x1B[38;2;107;166;255mBarnes–Hut\x1B[38;2;255;255;255m
|
|
413
|
+
\x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mis for: \`barnes_hut.py\` has it, at θ = 0.5.\x1B[38;2;255;255;255m
|
|
414
|
+
\x1B[38;2;135;150;173m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m
|
|
415
|
+
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
|
|
423
|
+
|
|
424
|
+
|
|
425
|
+
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
|
|
429
|
+
\x1B[38;2;240;190;74m╭─ tour · 10 of 12 ────────────────────────────╮\x1B[38;2;255;255;255m
|
|
430
|
+
\x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[1m\x1B[38;2;233;238;245mEvery change is kept\x1B[0m\x1B[38;2;255;255;255m\x1B[48;2;7;16;28m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
431
|
+
\x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;180;192;210m[t] lists the note's history. Choose a \x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
432
|
+
\x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;180;192;210mmoment to see the note as it was then; [q] \x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
433
|
+
\x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;180;192;210mcomes back to now.\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
434
|
+
\x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
435
|
+
\x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m■■■■■■■■■■\x1B[38;2;35;57;90m□□\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m/tour hides\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
436
|
+
\x1B[38;2;240;190;74m╰──────────────────────────────────────────────╯\x1B[38;2;255;255;255m
|
|
437
|
+
|
|
438
|
+
|
|
439
|
+
|
|
440
|
+
\x1B[48;2;12;24;40m \x1B[38;2;7;16;28m\x1B[48;2;233;238;245m note \x1B[38;2;255;255;255m\x1B[48;2;12;24;40m \x1B[38;2;135;150;173mnbody-notes\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m[n] next change\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m[t] timeline\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m[/] ask in place\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m[a] its atlas\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m[s] send to agent\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m[b] browser\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m[q] back\x1B[38;2;255;255;255m
|
|
441
|
+
`},{step:10,title:`Send it to the agent`,text:`[s] sends the paragraph the cursor is on to the agent, with what you want of it. It waits under "from you" for your next prompt.`,does:`press q, then s, and say what you want`,screen:`\x1B[38;2;255;255;255m\x1B[48;2;7;16;28m
|
|
442
|
+
\x1B[38;2;233;238;245msimulation / two galaxies colli\x1B[38;2;240;190;74m as it was just now: OpenCode · “add Barnes–Hut to the code, as my notes describe it, and note where\x1B[38;2;180;192;210mnot reached \x1B[38;2;35;57;90m□□□□□□\x1B[38;2;255;255;255m
|
|
443
|
+
|
|
444
|
+
\x1B[38;2;107;166;255m ■ │\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mTwo \x1B[38;2;107;166;255mPlummer spheres\x1B[38;2;233;238;245m of 1000 bodies each, set on a parabolic approach and \x1B[38;2;255;255;255m
|
|
445
|
+
\x1B[38;2;107;166;255m│\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mstepped with \x1B[38;2;107;166;255mthe main loop\x1B[38;2;233;238;245m. After the first pass, long tails of stars are \x1B[38;2;255;255;255m
|
|
446
|
+
\x1B[38;2;107;166;255m│\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mpulled out of each: the tidal tails that are seen in the sky.\x1B[38;2;255;255;255m
|
|
447
|
+
\x1B[38;2;135;150;173m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m
|
|
448
|
+
\x1B[38;2;135;150;173m ◆ \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mAt $N = 2000$ direct summation is slow but bearable. The tails are thin at \x1B[38;2;255;255;255m
|
|
449
|
+
\x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mthat resolution, and $N = 5000$ is where it starts to look right, but there \x1B[38;2;255;255;255m
|
|
450
|
+
\x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mdirect summation takes too long for an evening's run. That is what \x1B[38;2;107;166;255mBarnes–Hut\x1B[38;2;255;255;255m
|
|
451
|
+
\x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mis for: \`barnes_hut.py\` has it, at θ = 0.5.\x1B[38;2;255;255;255m
|
|
452
|
+
\x1B[38;2;135;150;173m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
|
|
457
|
+
|
|
458
|
+
|
|
459
|
+
|
|
460
|
+
|
|
461
|
+
|
|
462
|
+
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
|
|
468
|
+
|
|
469
|
+
|
|
470
|
+
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
\x1B[38;2;240;190;74m╭─ tour · 11 of 12 ────────────────────────────╮\x1B[38;2;255;255;255m
|
|
474
|
+
\x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[1m\x1B[38;2;233;238;245mSend it to the agent\x1B[0m\x1B[38;2;255;255;255m\x1B[48;2;7;16;28m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
475
|
+
\x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;180;192;210m[s] sends the paragraph the cursor is on to \x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
476
|
+
\x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;180;192;210mthe agent, with what you want of it. It \x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
477
|
+
\x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;180;192;210mwaits under "from you" for your next prompt.\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
478
|
+
\x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
479
|
+
\x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m■■■■■■■■■■■\x1B[38;2;35;57;90m□\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m/tour hides\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
480
|
+
\x1B[38;2;240;190;74m╰──────────────────────────────────────────────╯\x1B[38;2;255;255;255m
|
|
481
|
+
|
|
482
|
+
|
|
483
|
+
|
|
484
|
+
\x1B[48;2;12;24;40m \x1B[38;2;7;16;28m\x1B[48;2;233;238;245m note \x1B[38;2;255;255;255m\x1B[48;2;12;24;40m \x1B[38;2;135;150;173mnbody-notes\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m[q] back to now\x1B[38;2;255;255;255m
|
|
485
|
+
`},{step:11,title:`That is the terminal`,text:`On your own base: isorite term <base>. Point it at a model with ISORITE_GATEWAY_URL, or use OpenCode's own. /tour hides this card, /next closes it.`,does:`press q, then type /next`,screen:`\x1B[38;2;255;255;255m\x1B[48;2;7;16;28m
|
|
486
|
+
\x1B[38;2;233;238;245msimulation / two galaxies colliding\x1B[38;2;255;255;255m \x1B[38;2;180;192;210mnot reached \x1B[38;2;35;57;90m□□□□□□\x1B[38;2;255;255;255m
|
|
487
|
+
|
|
488
|
+
\x1B[38;2;107;166;255m ■ │\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mTwo \x1B[38;2;107;166;255mPlummer spheres\x1B[38;2;233;238;245m of 1000 bodies each, set on a parabolic approach and \x1B[38;2;255;255;255m
|
|
489
|
+
\x1B[38;2;107;166;255m│\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mstepped with \x1B[38;2;107;166;255mthe main loop\x1B[38;2;233;238;245m. After the first pass, long tails of stars are \x1B[38;2;255;255;255m
|
|
490
|
+
\x1B[38;2;107;166;255m│\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mpulled out of each: the tidal tails that are seen in the sky.\x1B[38;2;255;255;255m
|
|
491
|
+
\x1B[38;2;135;150;173m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m
|
|
492
|
+
\x1B[38;2;240;190;74m ◇ \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · ·\x1B[38;2;255;255;255m
|
|
493
|
+
\x1B[38;2;135;150;173m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mIn 3D the same tree has eight children a node: an octree.\x1B[38;2;255;255;255m
|
|
494
|
+
\x1B[38;2;135;150;173m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m◆ Iso\x1B[38;2;135;150;173m · not kept yet \x1B[38;2;95;211;164m[k] keep \x1B[38;2;240;190;74m[e] edit \x1B[38;2;255;143;166m[r] remove\x1B[38;2;255;255;255m
|
|
495
|
+
\x1B[38;2;135;150;173m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m“say what changes in 3D”\x1B[38;2;255;255;255m
|
|
496
|
+
\x1B[38;2;240;190;74m ◇ \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · ·\x1B[38;2;255;255;255m
|
|
497
|
+
\x1B[38;2;135;150;173m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m
|
|
498
|
+
\x1B[38;2;135;150;173m ◆ \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mAt $N = 2000$ direct summation is slow but bearable. The tails are thin at \x1B[38;2;255;255;255m
|
|
499
|
+
\x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mthat resolution, and $N = 5000$ is where it starts to look right, but there \x1B[38;2;255;255;255m
|
|
500
|
+
\x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mdirect summation takes too long for an evening's run. That is what \x1B[38;2;107;166;255mBarnes–Hut\x1B[38;2;255;255;255m
|
|
501
|
+
\x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m \x1B[38;2;233;238;245mis for: \`barnes_hut.py\` has it, at θ = 0.5.\x1B[38;2;255;255;255m
|
|
502
|
+
\x1B[38;2;135;150;173m \x1B[38;2;35;57;90m│\x1B[38;2;255;255;255m
|
|
503
|
+
|
|
504
|
+
|
|
505
|
+
|
|
506
|
+
|
|
507
|
+
|
|
508
|
+
|
|
509
|
+
|
|
510
|
+
|
|
511
|
+
|
|
512
|
+
|
|
513
|
+
|
|
514
|
+
|
|
515
|
+
|
|
516
|
+
\x1B[38;2;240;190;74m╭─ tour · 12 of 12 ────────────────────────────╮\x1B[38;2;255;255;255m
|
|
517
|
+
\x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[1m\x1B[38;2;233;238;245mThat is the terminal\x1B[0m\x1B[38;2;255;255;255m\x1B[48;2;7;16;28m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
518
|
+
\x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;180;192;210mOn your own base: isorite term <base>. Point\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
519
|
+
\x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;180;192;210mit at a model with ISORITE_GATEWAY_URL, or \x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
520
|
+
\x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;180;192;210muse OpenCode's own. /tour hides this card, /\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
521
|
+
\x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;180;192;210mnext closes it.\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
522
|
+
\x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
523
|
+
\x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m■■■■■■■■■■■■\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m/next /tour hides\x1B[38;2;255;255;255m \x1B[38;2;240;190;74m│\x1B[38;2;255;255;255m
|
|
524
|
+
\x1B[38;2;240;190;74m╰──────────────────────────────────────────────╯\x1B[38;2;255;255;255m
|
|
525
|
+
|
|
526
|
+
|
|
527
|
+
|
|
528
|
+
\x1B[48;2;12;24;40m \x1B[38;2;7;16;28m\x1B[48;2;233;238;245m note \x1B[38;2;255;255;255m\x1B[48;2;12;24;40m \x1B[38;2;135;150;173mnbody-notes\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m[n] next change\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m[t] timeline\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m[/] ask in place\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m[a] its atlas\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m[s] send to agent\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m[b] browser\x1B[38;2;255;255;255m \x1B[38;2;135;150;173m[q] back\x1B[38;2;255;255;255m
|
|
529
|
+
`}]},w=[`#000000`,`#cd0000`,`#00cd00`,`#cdcd00`,`#0000ee`,`#cd00cd`,`#00cdcd`,`#e5e5e5`,`#7f7f7f`,`#ff0000`,`#00ff00`,`#ffff00`,`#5c5cff`,`#ff00ff`,`#00ffff`,`#ffffff`];function T(e){if(e<16)return w[e];if(e>=232){let t=8+(e-232)*10;return`rgb(${t},${t},${t})`}let t=[0,95,135,175,215,255],n=e-16;return`rgb(${t[Math.floor(n/36)]},${t[Math.floor(n/6)%6]},${t[n%6]})`}function E(e){let t={fg:null,bg:null,bold:!1,italic:!1,underline:!1,strike:!1,dim:!1},n=()=>({fg:null,bg:null,bold:!1,italic:!1,underline:!1,strike:!1,dim:!1});return e.replace(/\n$/,``).split(`
|
|
530
|
+
`).map(e=>{let r=[];for(let i of e.split(/(\x1b\[[0-9;:]*m)/)){let e=/^\x1b\[([0-9;:]*)m$/.exec(i);if(e){let r=(e[1]||`0`).split(/[;:]/).map(Number);for(let e=0;e<r.length;e++){let i=r[e];if(i===0)t=n();else if(i===1)t.bold=!0;else if(i===2)t.dim=!0;else if(i===3)t.italic=!0;else if(i===4)t.underline=!0;else if(i===9)t.strike=!0;else if(i===22)t.bold=!1,t.dim=!1;else if(i===23)t.italic=!1;else if(i===24)t.underline=!1;else if(i===29)t.strike=!1;else if(i===39)t.fg=null;else if(i===49)t.bg=null;else if(i>=30&&i<=37)t.fg=T(i-30);else if(i>=90&&i<=97)t.fg=T(i-82);else if(i>=40&&i<=47)t.bg=T(i-40);else if(i>=100&&i<=107)t.bg=T(i-92);else if(i===38||i===48){let n=null;r[e+1]===2?(n=`rgb(${r[e+2]},${r[e+3]},${r[e+4]})`,e+=4):r[e+1]===5&&(n=T(r[e+2]),e+=2),i===38?t.fg=n:t.bg=n}}}else for(let e of i)r.push({ch:e,...t})}return r})}var D={"─":[0,1,0,1],"━":[0,2,0,2],"│":[1,0,1,0],"┃":[2,0,2,0],"╌":[0,1,0,1,!0],"╎":[1,0,1,0,!0],"┄":[0,1,0,1,!0],"┆":[1,0,1,0,!0],"┌":[0,1,1,0],"┐":[0,0,1,1],"└":[1,1,0,0],"┘":[1,0,0,1],"╭":[0,1,1,0],"╮":[0,0,1,1],"╰":[1,1,0,0],"╯":[1,0,0,1],"┏":[0,2,2,0],"┓":[0,0,2,2],"┗":[2,2,0,0],"┛":[2,0,0,2],"├":[1,1,1,0],"┤":[1,0,1,1],"┬":[0,1,1,1],"┴":[1,1,0,1],"┼":[1,1,1,1],"╹":[2,0,0,0],"╻":[0,0,2,0],"╸":[0,0,0,2],"╺":[0,2,0,0],"╵":[1,0,0,0],"╷":[0,0,1,0],"╴":[0,0,0,1],"╶":[0,1,0,0]},O={"▘":1,"▝":2,"▀":3,"▖":4,"▌":5,"▞":6,"▛":7,"▗":8,"▚":9,"▐":10,"▜":11,"▄":12,"▙":13,"▟":14,"█":15},k={"▁":[0,7,8,1],"▂":[0,6,8,2],"▃":[0,5,8,3],"▅":[0,3,8,5],"▆":[0,2,8,6],"▇":[0,1,8,7],"▔":[0,0,8,1],"▏":[0,0,1,8],"▎":[0,0,2,8],"▍":[0,0,3,8],"▋":[0,0,5,8],"▊":[0,0,6,8],"▉":[0,0,7,8],"▕":[7,0,1,8]},A={"░":.25,"▒":.5,"▓":.75},j={"":[[0,0],[0,1],[1,1]],"◣":[[0,0],[0,1],[1,1]],"":[[1,0],[1,1],[0,1]],"◢":[[1,0],[1,1],[0,1]],"":[[0,0],[1,0],[0,1]],"◤":[[0,0],[1,0],[0,1]],"":[[0,0],[1,0],[1,1]],"◥":[[0,0],[1,0],[1,1]]};function M(e,t){return e.font=`${t}px "Ioskeley Mono", ui-monospace, monospace`,{cell:e.measureText(`M`).width,row:Math.round(t*1.3),size:t}}function N(e,t,n,r,i){let{cell:a,row:o,size:s}=n;e.fillStyle=i,e.fillRect(0,0,e.canvas.width,e.canvas.height),e.textBaseline=`middle`,t.forEach((t,n)=>t.forEach((t,r)=>{t.bg&&(e.fillStyle=t.bg,e.fillRect(r*a,n*o,a+.5,o+.5))})),t.forEach((t,n)=>{let i=n*o;t.forEach((t,n)=>{let c=n*a;if(t.ch===` `)return;e.globalAlpha=t.dim?.6:1,e.fillStyle=e.strokeStyle=t.fg??r;let l=O[t.ch],u=k[t.ch],d=A[t.ch],f=j[t.ch],p=D[t.ch];if(l!==void 0)[[0,0],[1,0],[0,1],[1,1]].forEach(([t,n],r)=>{l>>r&1&&e.fillRect(c+t*a/2,i+n*o/2,a/2+.5,o/2+.5)});else if(u)e.fillRect(c+u[0]*a/8,i+u[1]*o/8,u[2]*a/8+.5,u[3]*o/8+.5);else if(d!==void 0)e.globalAlpha*=d,e.fillRect(c,i,a+.5,o+.5);else if(f)e.beginPath(),f.forEach(([t,n],r)=>(r?e.lineTo:e.moveTo).call(e,c+t*(a+.5),i+n*(o+.5))),e.closePath(),e.fill();else if(p){let[t,n,r,l,u]=p,d=c+a/2,f=i+o/2,m=e=>Math.max(1,Math.round(s/(e===2?7:14))),h=(t,n,r,i,a)=>{t&&(e.lineWidth=m(t),e.setLineDash(u?[Math.max(2,(i-n||a-r)/3)]:[]),e.beginPath(),e.moveTo(n,r),e.lineTo(i,a),e.stroke())},g=m(Math.max(t,n,r,l))/2;h(t,d,i,d,f+(l||n?g:0)),h(r,d,f-(l||n?g:0),d,i+o),h(l,c,f,d+(t||r?g:0),f),h(n,d-(t||r?g:0),f,c+a,f),e.setLineDash([])}else e.font=`${t.italic?`italic `:``}${t.bold?`700 `:``}${s}px "Ioskeley Mono", ui-monospace, monospace`,e.fillText(t.ch,c,i+o/2),t.underline&&e.fillRect(c,i+o-2,a,1),t.strike&&e.fillRect(c,i+o/2,a,1);e.globalAlpha=1})})}var P=e(`<button type="button"></button>`),F=e(`<div class="terminal svelte-1dhdpeh"><header class="svelte-1dhdpeh"><h1 class="svelte-1dhdpeh">isorite in the terminal</h1> <p class="svelte-1dhdpeh">A replay of the terminal's tour: OpenCode, with isorite's plugin, on the example base, its model scripted. Every screen is the real one. To walk it yourself, with OpenCode 2 installed: <code class="svelte-1dhdpeh">isorite --tutorial</code>.</p></header> <div class="stage svelte-1dhdpeh"><figure class="screen svelte-1dhdpeh"><canvas class="svelte-1dhdpeh"></canvas></figure> <aside class="card frame svelte-1dhdpeh"><div class="seg svelte-1dhdpeh"></div> <h2 class="svelte-1dhdpeh"> </h2> <p class="svelte-1dhdpeh"> </p> <p class="does svelte-1dhdpeh"><span class="label svelte-1dhdpeh">then</span> </p> <div class="actions svelte-1dhdpeh"><button class="btn quiet svelte-1dhdpeh" type="button">back</button> <span class="grow svelte-1dhdpeh"></span> <button class="btn primary svelte-1dhdpeh" type="button">next</button></div> <p class="keys svelte-1dhdpeh">← and → step through it.</p></aside></div></div>`);function I(e,o){p(o,!0);let w=C.frames,T=w.map(e=>E(e.screen)),D=l(0),O=l(void 0),k=h(()=>w[r(D)]),A=e=>{f(D,Math.max(0,Math.min(w.length-1,e)),!0)};function j(){let e=r(O)?.getContext(`2d`);if(!e||!r(O))return;let t=M(e,28);r(O).width=Math.ceil(C.cols*t.cell),r(O).height=C.rows*t.row,N(e,T[r(D)],t,`#E9EEF5`,`#07101C`)}n(()=>{r(D),r(O),j()}),y(()=>{document.fonts.load(`28px "Ioskeley Mono"`).then(j);let e=e=>{e.key===`ArrowRight`?A(r(D)+1):e.key===`ArrowLeft`&&A(r(D)-1)};return addEventListener(`keydown`,e),()=>removeEventListener(`keydown`,e)});var I=F(),L=d(a(I),2),R=a(L),z=a(R);b(z,e=>f(O,e),()=>r(O)),v(R);var B=d(R,2),V=a(B);S(V,23,()=>w,e=>e.step,(e,t,n)=>{var i=P();let a;u(()=>{x(i,`aria-label`,`step ${r(n)+1}: ${r(t).title??``}`),a=g(i,1,`svelte-1dhdpeh`,null,a,{d:r(n)<=r(D)})}),c(`click`,i,()=>A(r(n))),s(e,i)}),v(V);var H=d(V,2),U=i(H,!0),W=d(H,2),G=i(W,!0),K=d(W,2),q=d(a(K));v(K);var J=d(K,2),Y=a(J),X=d(Y,4);v(J),m(2),v(B),v(L),v(I),u(()=>{x(z,`aria-label`,`the terminal at step ${r(D)+1}: ${r(k).title??``}`),x(V,`aria-label`,`step ${r(D)+1} of ${w.length??``}`),t(U,r(k).title),t(G,r(k).text),t(q,` ${r(k).does??``}`),Y.disabled=r(D)===0,X.disabled=r(D)===w.length-1}),c(`click`,Y,()=>A(r(D)-1)),c(`click`,X,()=>A(r(D)+1)),s(e,I),_()}o([`click`]);export{I as component};
|