(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:wordlib) op: assign_op.Equal rhs: {(DQ (/usr/lib/games/long-words.txt))} spids: [16] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:empty) op: assign_op.Equal rhs: {(DQ (Id.Lit_Other '\\') (.))} spids: [21] ) ] ) (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:games) op:assign_op.Equal rhs:{(0)} spids:[30])] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {(Id.KW_Bang '!')} {(-r)} {(DQ ($ Id.VSub_DollarName '$wordlib'))} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:52) ) ] action: [ (command.Simple words: [ {(echo)} { (DQ ($ Id.VSub_Number '$0') (': Missing word library ') ($ Id.VSub_DollarName '$wordlib') ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:65) fd: -1 arg_word: {(2)} ) ] ) (command.Simple words: [ {(echo)} {(DQ ('(online: http://www.intuitive.com/wicked/examples/long-words.txt'))} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:75) fd: -1 arg_word: {(2)} ) ] ) (command.Simple words: [ {(echo)} { (DQ ('save the file as ') ($ Id.VSub_DollarName '$wordlib') (" and you're ready to play!)") ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:87) fd: -1 arg_word: {(2)} ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:91) arg_word: {(1)} ) ] spids: [38 54] ) ] ) (command.WhileUntil keyword: (Token id:Id.KW_While val:while span_id:102) cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {(DQ ($ Id.VSub_DollarName '$guess'))} {(Id.KW_Bang '!') (Id.Lit_Equals '=')} {(DQ (quit))} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:119) ) ] body: (command.DoGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:match) op: assign_op.Equal rhs: { (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:126) command_list: (command.CommandList children: [(C {(randomquote)} {($ Id.VSub_DollarName '$wordlib')})] ) ) ) } spids: [124] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {($ Id.VSub_DollarName '$games')} {(-gt)} {(0)} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:150) ) ] action: [(C {(echo)} {(DQ )}) (C {(echo)} {(DQ ('*** New Game! ***'))})] spids: [138 152] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:games) op: assign_op.Equal rhs: { (DQ (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Plus left: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$games')}) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)}) ) ) ) } spids: [172] ) ] ) (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:guessed) op: assign_op.Equal rhs: {(DQ )} spids: [187] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:191) ) (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:guess) op: assign_op.Equal rhs: {(DQ )} spids: [193] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:197) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:bad) op: assign_op.Equal rhs: { (braced_var_sub token: (Token id:Id.VSub_Number val:1 span_id:201) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:{(6)}) ) } spids: [199] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:partial) op: assign_op.Equal rhs: { (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:209) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(echo)} {($ Id.VSub_DollarName '$match')}) (C {(sed)} { (DQ ('s/[^') ($ Id.VSub_DollarName '$empty') (${ Id.VSub_Name guessed) (']/-/g') ) } ) ] negated: F ) ] ) ) ) } spids: [207] ) ] ) (command.WhileUntil keyword: (Token id:Id.KW_While val:while span_id:236) cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {(DQ ($ Id.VSub_DollarName '$guess'))} {(Id.KW_Bang '!') (Id.Lit_Equals '=')} {(DQ ($ Id.VSub_DollarName '$match'))} {(-a)} {(DQ ($ Id.VSub_DollarName '$guess'))} {(Id.KW_Bang '!') (Id.Lit_Equals '=')} {(DQ (quit))} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:266) ) ] body: (command.DoGroup children: [ (C {(echo)} {(DQ )}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {(Id.KW_Bang '!')} {(-z)} {(DQ ($ Id.VSub_DollarName '$guessed'))} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:292) ) ] action: [ (C {(/bin/echo)} {(-n)} {(DQ ('Guessed: ') ($ Id.VSub_DollarName '$guessed') (', '))} ) ] spids: [278 294] ) ] ) (C {(echo)} { (DQ ('Steps from gallows: ') ($ Id.VSub_DollarName '$bad') (', word so far: ') ($ Id.VSub_DollarName '$partial') ) } ) (C {(/bin/echo)} {(-n)} {(DQ ('Guess a letter: '))}) (C {(read)} {(guess)}) (C {(echo)} {(DQ )}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {(DQ ($ Id.VSub_DollarName '$guess'))} {(Id.Lit_Equals '=')} {(DQ ($ Id.VSub_DollarName '$match'))} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:363) ) ] action: [(C {(echo)} {(DQ ('You got it!'))})] spids: [347 365] ) (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {(DQ ($ Id.VSub_DollarName '$guess'))} {(Id.Lit_Equals '=')} {(DQ (quit))} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:394) ) ] action: [(C {(sleep)} {(0)})] spids: [378 396] ) (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:418) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(echo)} {($ Id.VSub_DollarName '$guess')}) (C {(wc)} {(-c)}) (C {(sed)} { (SQ (Token id: Id.Lit_Chars val: 's/[^[:digit:]]//g' span_id: 434 ) ) } ) ] negated: F ) ] ) ) } {(-ne)} {(2)} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:444) ) ] action: [ (C {(echo)} {(DQ ('Uh oh: You can only guess a single letter at a time'))}) ] spids: [414 446] ) (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {(Id.KW_Bang '!')} {(-z)} { (DQ (command_sub left_token: (Token id: Id.Left_DollarParen val: '$(' span_id: 466 ) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(echo)} {($ Id.VSub_DollarName '$guess')}) (C {(sed)} { (SQ (Token id: Id.Lit_Chars val: 's/[[:lower:]]//g' span_id: 476 ) ) } ) ] negated: F ) ] ) ) ) } {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:483) ) ] action: [ (C {(echo)} {(DQ ('Uh oh: Please only use lowercase letters for your guesses'))} ) ] spids: [457 485] ) (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {(-z)} { (DQ (command_sub left_token: (Token id: Id.Left_DollarParen val: '$(' span_id: 502 ) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(echo)} {($ Id.VSub_DollarName '$guess')}) (C {(sed)} { (DQ ('s/[') ($ Id.VSub_DollarName '$empty') ($ Id.VSub_DollarName '$guessed') (']//g') ) } ) ] negated: F ) ] ) ) ) } {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:522) ) ] action: [ (C {(echo)} { (DQ ('Uh oh: You have already tried ') ($ Id.VSub_DollarName '$guess')) } ) ] spids: [495 524] ) (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} { (DQ (command_sub left_token: (Token id: Id.Left_DollarParen val: '$(' span_id: 544 ) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(echo)} {($ Id.VSub_DollarName '$match')}) (C {(sed)} {(DQ (s/) ($ Id.VSub_DollarName '$guess') (/-/g))} ) ] negated: F ) ] ) ) ) } {(Id.KW_Bang '!') (Id.Lit_Equals '=')} {(DQ ($ Id.VSub_DollarName '$match'))} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:570) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:guessed) op: assign_op.Equal rhs: { (DQ ($ Id.VSub_DollarName '$guessed') ($ Id.VSub_DollarName '$guess') ) } spids: [575] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:partial) op: assign_op.Equal rhs: { (DQ (command_sub left_token: (Token id: Id.Left_DollarParen val: '$(' span_id: 584 ) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(echo)} {($ Id.VSub_DollarName '$match')}) (C {(sed)} { (DQ ('s/[^') ($ Id.VSub_DollarName '$empty') (${ Id.VSub_Name guessed) (']/-/g') ) } ) ] negated: F ) ] ) ) ) } spids: [582] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {(DQ ($ Id.VSub_DollarName '$partial'))} {(Id.Lit_Equals '=')} {(DQ ($ Id.VSub_DollarName '$match'))} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:621) ) ] action: [ (C {(echo)} { (DQ ("** You've been pardoned!! Well done! The word was ") (word_part.EscapedLiteral token: (Token id: Id.Lit_EscapedChar val: '\\"' span_id: 630 ) ) ($ Id.VSub_DollarName '$match') (word_part.EscapedLiteral token: (Token id: Id.Lit_EscapedChar val: '\\"' span_id: 632 ) ) (.) ) } ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:guess) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_DollarName '$match'))} spids: [637] ) ] ) ] spids: [605 623] ) ] else_action: [ (C {(echo)} { (DQ ('* Great! The letter ') (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:651) ) ($ Id.VSub_DollarName '$guess') (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:653) ) (' appears in the word!') ) } ) ] ) ] spids: [539 572] ) (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {($ Id.VSub_DollarName '$bad')} {(-eq)} {(1)} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:673) ) ] action: [ (C {(echo)} { (DQ ( "** Uh oh: you've run out of steps. You're on the platform... <SNAP!>" ) ) } ) (C {(echo)} { (DQ ('** The word you were trying to guess was ') (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:689) ) ($ Id.VSub_DollarName '$match') (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:691) ) ) } ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:guess) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_DollarName '$match'))} spids: [695] ) ] ) ] spids: [661 675] ) ] else_action: [ (C {(echo)} { (DQ ('* Nope, ') (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:708) ) ($ Id.VSub_DollarName '$guess') (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:710) ) (' does not appear in the word.') ) } ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:guessed) op: assign_op.Equal rhs: { (DQ ($ Id.VSub_DollarName '$guessed') ($ Id.VSub_DollarName '$guess') ) } spids: [715] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:bad) op: assign_op.Equal rhs: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Minus left: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$bad')}) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)}) ) ) } spids: [722] ) ] ) ] ) ] ) ) ] ) ) (command.ControlFlow token:(Token id:Id.ControlFlow_Exit val:exit span_id:742) arg_word:{(0)}) ] )