collaborate@theplanetearthsociety.com
561.376.8781
Planet Earth Society > Platform > Hacktorscript Example

Example Script

HacktorScript runs on many platforms. For fun, this script will play every song found in the directory (folder) of music passed in as an argument.

If you’re interested in diving deeper, send a note to collaborate.


LET

$playsongs CREATE FUNCTION ( $songlist $customer )
IF OPER OPER $songlist count OPER; > 0 OPER; (
LET
$self _SELF_
$next CREATE FUNCTION ( ) SEND $self OPER $songlist tail OPER; $customer SEND;
FUNCTION; CREATE;
SEND $bård #play OPER $songlist first OPER; $next SEND;
LET;
)
$true SEND $customer The songs are over SEND;
IF;
FUNCTION; CREATE;

$forwarder CREATE FUNCTION ( $list )
SEND $playsongs $list $println SEND;
FUNCTION; CREATE;

SEND $bård #readdir $2 $forwarder SEND;

LET;