Created
October 17, 2024 04:29
-
-
Save HactarCE/515fd10b644a85bc3a95e20267a5d8d2 to your computer and use it in GitHub Desktop.
cha_cha_slide.lua
This file contains 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
#!/usr/bin/env lua | |
-- Casper Slide: Part 2 | |
require "platinum_band" | |
funky = false -- will be set to true on 3rd iteration | |
right_foot = Foot:new() | |
left_foot = Foot:new() | |
-- everybody clap your hands | |
for i = 1, 2 do | |
clap() | |
clap() | |
clap() | |
clap() | |
end | |
-- basic step | |
for i = 1, 8 do | |
if i == 3 then | |
funky = true | |
else | |
funky = false | |
end | |
if i == 2 then turn() end | |
if i == 4 then goto work end | |
if i == 5 then turn() end | |
if i == 7 then turn() end | |
if i == 8 then turn() end | |
::work:: | |
if funky then right() end | |
if i ~= 6 then | |
left() | |
back() | |
end | |
if i % 4 == 0 then | |
hop(2) | |
hop(2) | |
elseif i == 5 then | |
hop(5) | |
else | |
hop(1) | |
if funky or i == 7 then | |
hop(1) | |
end | |
end | |
if i ~= 7 then | |
if i < 3 or i > 4 then | |
right_foot:stomp() | |
left_foot:stomp() | |
else | |
right_foot:stomp(2) | |
left_foot:stomp(2) | |
end | |
end | |
if i == 5 then | |
right_foot:stomp() -- again | |
left_foot:stomp() -- again | |
right_foot:stomp() | |
left_foot:stomp() | |
freeze() | |
-- everybody clap your hands | |
for j = 1, 8 do | |
clap() | |
clap() | |
clap() | |
clap() | |
end | |
end | |
if i == 4 then | |
hands_on_knees {} | |
hands_on_knees { | |
funky = true | |
} | |
end | |
if i == 7 then | |
reverse() | |
reverse() | |
end | |
if funky or i == 7 then | |
slide_left() | |
slide_right() | |
end | |
if funky then | |
criss_cross() | |
criss_cross() | |
end | |
if i == 7 then | |
reverse() reverse() | |
reverse() reverse() | |
end | |
if i == 8 then | |
charlie_brown() -- I don't know what this is but if | |
-- I remove it everything breaks | |
slide_right() | |
slide_left() | |
back() | |
end | |
if i % 2 == 1 and i < 5 or i == 6 then | |
cha_cha { smooth = true } | |
elseif i == 7 then | |
cha_cha {} | |
cha_cha {} -- again | |
cha_cha {} | |
cha_cha {} -- again | |
elseif i ~= 5 then | |
cha_cha {} | |
else | |
goto low | |
::low:: | |
goto floor | |
::floor:: | |
-- end of loop will goto top | |
end | |
end | |
-- I'm outta here y'all | |
-- peace! |
This file contains 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
-- prints lyrics as they execute in cha_cha_slide.lua | |
function clap() | |
print("clap") | |
end | |
function left() | |
print("to the left") | |
end | |
function right() | |
print("to the right") | |
end | |
function back() | |
print("take it back now y'all") | |
end | |
function slide_left() | |
print("slide to the left") | |
end | |
function slide_right() | |
print("slide to the right") | |
end | |
function criss_cross() | |
print("criss cross") | |
end | |
function turn() | |
print("turn it out") | |
end | |
function hop(n) | |
local hops = (n and n > 1) and "hops" or "hop" | |
print((n or 1) .. " " .. hops .. " this time") | |
end | |
function cha_cha(args) | |
if args.smooth then | |
print("cha cha real smooth") | |
else | |
print("cha cha now y'all") | |
end | |
end | |
function hands_on_knees() | |
print("hands on your knees") | |
end | |
function freeze() | |
print("freeze") | |
end | |
function reverse() | |
print("reverse") | |
end | |
function charlie_brown() | |
print("charlie brown") | |
end | |
Foot = {} | |
foot_name = "right" | |
function Foot:new() | |
t = { | |
name = foot_name, | |
stomp = Foot.stomp, | |
} | |
if foot_name == "right" then foot_name = "left" end -- for next foot | |
return t | |
end | |
function Foot:stomp(n) | |
if n then | |
print(self.name .. " foot " .. n .. " stomps") | |
else | |
print(self.name .. " foot let's stomp") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment