visualcopium 1.0.9 → 1.1.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/README.md +61 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<h1>Visualcopium</h1>
|
|
3
|
+
<p>Copium for visual programmers!</p>
|
|
4
|
+
</div>
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You don't need a silly custom language, you don't need Scratch. You need a brittle cross between semi-real code (aka JavaScript, but how real is that?) and visualness!
|
|
9
|
+
|
|
10
|
+
[(skip to installation)](#installation)
|
|
11
|
+
|
|
12
|
+
**Visualcopium** does just that! We provide separate "blocks" for both the web and Node.js/Bun, but also some generic ones. And to prove its amazingness, here's some examples:
|
|
13
|
+
|
|
14
|
+
Repeating is fun!
|
|
15
|
+
|
|
16
|
+
```javascript
|
|
17
|
+
Repeat(10 /*times*/, () => {
|
|
18
|
+
// some code that does stuff 10 times :)
|
|
19
|
+
var message = Ask("Do you wanna? ") // you can ask the user stuff!
|
|
20
|
+
Say("Here's a number anyways! " + PickRandom(1, 100)) // you can say stuff back!
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
var canBeFalseIdfk = true
|
|
24
|
+
RepeatWhile(() => canBeFalseIdfk, () => {
|
|
25
|
+
canBeFalseIdfk = false
|
|
26
|
+
Say("Yay canBeFalseIdfk is now false!")
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
RepeatWhile(false, () => { // Your condition can also directly be a boolean! Or a number, anything except 0 becomes true.
|
|
30
|
+
SayError("Bro if you can see this your computer might be broken :(")
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
Forever(() => {
|
|
34
|
+
// dude this'll NEVER stop :sob:
|
|
35
|
+
SayError("Why did you finish already? Here's an error you ajfojafjiwaifju!!")
|
|
36
|
+
|
|
37
|
+
if (KeyPressed("Escape")) {
|
|
38
|
+
SayError("There is no escape!")
|
|
39
|
+
}
|
|
40
|
+
})
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Installation
|
|
44
|
+
|
|
45
|
+
And if you're a silly person, there's an optional block that waits for this supposed page to load:
|
|
46
|
+
|
|
47
|
+
```javascript
|
|
48
|
+
WhenFlagClicked(() => {
|
|
49
|
+
// some code that does stuff AFTER the page loads...
|
|
50
|
+
})
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
You can either install our JavaScript (NPM) package globally, or make a lil project folder. Either way!
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
npm install -g visualcopium
|
|
57
|
+
|
|
58
|
+
# ORRRR make your own lil project folder :)
|
|
59
|
+
npm init
|
|
60
|
+
npm install visualcopium
|
|
61
|
+
```
|
package/dist/index.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ export declare function RepeatUntil(condition: Condition, callback: () => void):
|
|
|
25
25
|
*/
|
|
26
26
|
export declare function RepeatWhile(condition: Condition, callback: () => void): void;
|
|
27
27
|
/**
|
|
28
|
-
* Repeats the code block/function forever.
|
|
28
|
+
* Repeats the code block/function forever. Everything after will now continue while this repeats!
|
|
29
29
|
* @param callback Code block/function
|
|
30
30
|
*/
|
|
31
31
|
export declare function Forever(callback: () => void): void;
|
package/dist/index.js
CHANGED
|
@@ -35,12 +35,11 @@ export function RepeatWhile(condition, callback) {
|
|
|
35
35
|
callback();
|
|
36
36
|
}
|
|
37
37
|
/**
|
|
38
|
-
* Repeats the code block/function forever.
|
|
38
|
+
* Repeats the code block/function forever. Everything after will now continue while this repeats!
|
|
39
39
|
* @param callback Code block/function
|
|
40
40
|
*/
|
|
41
41
|
export function Forever(callback) {
|
|
42
|
-
|
|
43
|
-
callback();
|
|
42
|
+
setInterval(callback, 0);
|
|
44
43
|
}
|
|
45
44
|
// Math
|
|
46
45
|
/**
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAUA,UAAU;AAEV;;;;GAIG;AACH,MAAM,UAAU,MAAM,CAAC,KAAa,EAAE,QAAoB;IACzD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE;QAAE,QAAQ,EAAE,CAAA;AAC3C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,SAAoB,EAAE,QAAoB;IACrE,OACC,CAAC,CAAC,GAAG,EAAE,CACN,OAAO,SAAS,IAAI,QAAQ;QAC3B,CAAC,CAAC,SAAS,IAAI,CAAC;QAChB,CAAC,CAAC,OAAO,SAAS,IAAI,SAAS;YAC9B,CAAC,CAAC,SAAS;YACX,CAAC,CAAC,SAAS,EAAE,CAAC,EAAE;QAEnB,QAAQ,EAAE,CAAA;AACZ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,SAAoB,EAAE,QAAoB;IACrE,OACC,CAAC,GAAG,EAAE,CACL,OAAO,SAAS,IAAI,QAAQ;QAC3B,CAAC,CAAC,SAAS,IAAI,CAAC;QAChB,CAAC,CAAC,OAAO,SAAS,IAAI,SAAS;YAC9B,CAAC,CAAC,SAAS;YACX,CAAC,CAAC,SAAS,EAAE,CAAC,EAAE;QAEnB,QAAQ,EAAE,CAAA;AACZ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,OAAO,CAAC,QAAoB;IAC3C,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAUA,UAAU;AAEV;;;;GAIG;AACH,MAAM,UAAU,MAAM,CAAC,KAAa,EAAE,QAAoB;IACzD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE;QAAE,QAAQ,EAAE,CAAA;AAC3C,CAAC;AAED;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