@fraczak/k 4.0.3 → 5.0.0
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/BIG_PICTURE.md +28 -21
- package/README.md +158 -154
- package/TODO.md +18 -0
- package/TYPING.md +2 -2
- package/export.mjs +177 -0
- package/index.mjs +3 -15
- package/k-repl.cast +1913 -0
- package/k.cast +618 -0
- package/package.json +1 -1
- package/patterns.mjs +22 -8
- package/pretty.mjs +26 -41
- package/repl.mjs +47 -28
- package/run.mjs +5 -1
- package/TYPES.md +0 -32
- package/demo.cast +0 -1772
- package/demo.gif +0 -0
- package/demo2.cast +0 -1705
- package/demo_optimized.gif +0 -0
- package/sc.py +0 -25
package/demo_optimized.gif
DELETED
|
Binary file
|
package/sc.py
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import json
|
|
2
|
-
import sys
|
|
3
|
-
|
|
4
|
-
# Check if file is provided
|
|
5
|
-
if len(sys.argv) != 3:
|
|
6
|
-
print("Usage: python speedup_cast.py input.cast output.cast")
|
|
7
|
-
sys.exit(1)
|
|
8
|
-
|
|
9
|
-
input_file = sys.argv[1]
|
|
10
|
-
output_file = sys.argv[2]
|
|
11
|
-
speedup_factor = 0.5 # 2x speed
|
|
12
|
-
|
|
13
|
-
# Load the original cast file
|
|
14
|
-
with open(input_file, 'r') as f:
|
|
15
|
-
cast = json.load(f)
|
|
16
|
-
|
|
17
|
-
# Update the timing of each event
|
|
18
|
-
for event in cast['stdout']:
|
|
19
|
-
event[0] = event[0] * speedup_factor
|
|
20
|
-
|
|
21
|
-
# Save the modified cast file
|
|
22
|
-
with open(output_file, 'w') as f:
|
|
23
|
-
json.dump(cast, f)
|
|
24
|
-
|
|
25
|
-
print(f"Successfully sped up {input_file} and saved to {output_file}")
|