Skip to content

Instantly share code, notes, and snippets.

@Blueyescat
Last active October 6, 2021 10:37
Show Gist options
  • Save Blueyescat/8793eecf545088bf78007a18f19a2013 to your computer and use it in GitHub Desktop.
Save Blueyescat/8793eecf545088bf78007a18f19a2013 to your computer and use it in GitHub Desktop.
skript-parser test script
on script load:
set {_n::x} to 2
print "x = %{_n::x}%"
set {_n::y} to 10
print "y = %{_n::y}%"
set {_log} to log {_n::x} of {_n::y}
print "log %{_n::x}% of %{_n::y}% is %{_log}%"
set {_result} to 1.3 * (2 + ({_log} / 2))
print "1.3 * (2 + (%{_log}% / 2)) = %{_result}%"
print "%{_result}% ^ 2 + PI = %{_result} ^ 2 + pi%"
print "absolute of e = %abs e% (= %|e|%)"
if abs e = |e|:
print "yeah 'abs e' = '|e|'"
##############################################
print "4! = %4!% (= %factorial of 4%)"
print "sqrt 10 = %sqrt 10% (= %square root of 10%)"
print "rounded down 3.46 = %floored 3.46%"
print "rounded up 3.46 = %ceiled 3.46%"
print "rounded 3.6 = %rounded 3.6%"
print "rounded 3.1 = %rounded 3.1%"
print "sin 1 = %sin 1%"
print "cos 2.3 = %cos 2.3%"
print "tan 4.6 = %tan 4.6%"
print "asin 0.6 = %asin 0.6%"
print "acos 0 = %acos 0%"
print "atan 3.01 = %atan 3.01%"
print "ln5 = %ln 5%"
##############################################
print "phi = %PHI%"
set {x} to phi
print "{x} = %{x}%"
{x} += 3
print "^ increased by 3: %{x}%"
##############################################
set {_numbers::*} to 41.4, 32.19, 11.81, 12, 10.22, 41.3, 22.49, 1.6, 12 and 34.96
loop {_numbers::*}:
if loop-number > 12:
set {_text} to "adding to >12 list"
add loop-number to {_>12::*}
else if loop-number < 12:
set {_text} to "adding to <12 list"
add loop-number to {_<12::*}
print "%loop-number%, greater than 12: %whether loop-value is greater than 12% (%{_text}%)"
print "Numbers that is greater than 12: %{_>12::*}%"
print "Numbers that is smaller than 12: %{_<12::*}%"
remove {_>12::*} and {_<12::*} from {_numbers::*}
print "Not both: %{_numbers::*}%"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment