🏳️⚧️
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const dim_width = 200; | |
| const dim_height = 200; | |
| const scale_factor = 4; | |
| const real_width = dim_width * scale_factor; | |
| const real_height = dim_height * scale_factor; | |
| const center = { x: real_width / 2, y: real_height / 2 }; | |
| const bg_color = "#C71242"; | |
| const src_color = "##DAA520"; | |
| const to_color = "#483D8B"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const bg_color = "#DBD5CF"; | |
| const dim_height = 170; | |
| const dim_width = 130; | |
| const scale_factor = 4; | |
| const real_width = dim_width * scale_factor; | |
| const real_height = dim_height * scale_factor; | |
| const triW = (dim_width / 6) * scale_factor; | |
| const triH = (dim_height / 17) * scale_factor; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * The validation scheme for an option that is an object. | |
| * @since 0.11.0 | |
| */ | |
| export type KipperConfigObjectValidatorScheme = { | |
| [key: string]: "string" | "boolean" | "array<string>" | KipperConfigObjectValidatorScheme; | |
| } | |
| /** | |
| * The validation scheme for the Kipper config. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def isPrime(n: num) -> bool { | |
| if (n <= 1) { | |
| return false; // Never a prime | |
| } else if (n == 2 || n == 3) { | |
| return true; // Base primes | |
| } else if (n % 2 == 0 || n % 3 == 0) { | |
| return false; // Easy base prime checks | |
| } | |
| for (var i: num = 5; i * i <= n; i += 6) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def primeFactors(n: num) -> void { | |
| while (n % 2 == 0) { | |
| print("2"); | |
| n /= 2; | |
| } | |
| // For all non-even divisors | |
| for (var i: num = 3; i * i <= n; i += 2) { | |
| while (n % i == 0) { | |
| print(f"{i}"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def pow(base: num, powerTo: num) -> num { | |
| return base ** powerTo; | |
| } | |
| var result: num = pow(2, 8); // -> 256 | |
| print(result as str); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def add(firstNum: num, secondNum: num) -> num { | |
| return firstNum + secondNum; | |
| } | |
| var result: num = add(1, 2); | |
| print(result as str); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Jisho.org Support for Anki | |
| import os, re, json, requests, urllib.request, urllib.parse | |
| from aqt import gui_hooks | |
| from aqt import mw | |
| from aqt.qt import qconnect | |
| from aqt.editor import Editor | |
| from aqt.utils import showInfo | |
| from anki.utils import stripHTML |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var x: num = 5; | |
| def incr(val: num) -> void { x += val; } | |
| def prn(val: num) -> void { print(val as str); } | |
| /* Increment and print */ | |
| incr(5); | |
| prn(x); | |
| /* Increment and print */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Sample Script for showing the core functionality of how runtime types should work in Kipper. | |
| */ | |
| "use strict"; | |
| // @ts-ignore | |
| var __kipperGlobalScope = typeof __kipperGlobalScope !== "undefined" ? __kipperGlobalScope : typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {}; | |
| // @ts-ignore | |
| var __kipper = __kipperGlobalScope.__kipper = __kipperGlobalScope.__kipper || __kipper || {}; | |
| // The parent of all Kipper runtime types |
NewerOlder