# havana_crossfit_funcs !! set up wods if $ARGS[0] = 'setup_wod': killvar '$crossfit_wods' killvar 'wod_min_score' killvar 'wod_max_score' killvar '$wod_type' killvar '$wod_video' gs 'havana_crossfit_funcs', 'add_wod', 'Fran', 120, 600, 'for_time', 'pullup' gs 'havana_crossfit_funcs', 'add_wod', 'Nancy', 600, 1200, 'for_time', 'ohs' gs 'havana_crossfit_funcs', 'add_wod', 'Isabel', 90, 600, 'for_time', 'snatch' gs 'havana_crossfit_funcs', 'add_wod', 'Open 17.1', 600, 1200, 'for_time', 'dumbbell_snatch' gs 'havana_crossfit_funcs', 'add_wod', 'Open 16.1', 1300, 100, 'for_rounds', 'overhead_lunge' gs 'havana_crossfit_funcs', 'add_wod', 'Karen', 300, 720, 'for_time', 'wallball' end if $ARGS[0] = 'Fran': '- Thruster 65 lbs' '- Pull-ups' '21-15-9 repetitions each, for time' end if $ARGS[0] = 'Nancy': '- 400 meter run' '- Overhead squat 65 lbs x 15' '5 rounds for time' end if $ARGS[0] = 'Isabel': '- Snatch 95 pounds' '30 repetitions for time' end if $ARGS[0] = 'Open 17.1': ' - 10 dumbbell snatches' ' - 15 burpee box jump-overs' ' - 20 dumbbell snatches' ' - 15 burpee box jump-overs' ' - 30 dumbbell snatches' ' - 15 burpee box jump-overs' ' - 40 dumbbell snatches' ' - 15 burpee box jump-overs' ' - 50 dumbbell snatches' ' - 15 burpee box jump-overs' 'For time' end if $ARGS[0] = 'Open 16.1': ' - 25-ft. overhead walking lunge' ' - 8 burpees' ' - 25-ft. overhead walking lunge' ' - 8 chest-to-bar pull-ups' 'Complete as many rounds and reps as possible in 20 minutes' end if $ARGS[0] = 'Karen': '- 150 wallball shots' 'For time' end if $ARGS[0] = 'add_wod': $crossfit_wods[] = $ARGS[1] wod_min_score[$ARGS[1]] = ARGS[2] wod_max_score[$ARGS[1]] = ARGS[3] $wod_type[$ARGS[1]] = $ARGS[4] $wod_video[$ARGS[1]] = $ARGS[5] end if $ARGS[0] = 'recordstring': if ARGS[2] = 0: $result = 'No score yet' else wod_score = wod_min_score[$ARGS[1]] + (wod_max_score[$ARGS[1]] - wod_min_score[$ARGS[1]]) * ARGS[2] / 100 if $wod_type[$ARGS[1]] = 'for_time': $result = '<> minutes and <> seconds' end if $wod_type[$ARGS[1]] = 'for_rounds': $result = '<> rounds and <>% of the last one' end end end if $ARGS[0] = 'update_box_records': if last_box_record_update = 0 or last_box_record_update + 30 < daystart: number_of_box_record_updates = 30 else number_of_box_record_updates = daystart - last_box_record_update end last_box_record_update = daystart current_record_update_count = 0 :recordupdateloop if current_record_update_count < number_of_box_record_updates: gs 'havana_crossfit_funcs', 'box_records' current_record_update_count += 1 jump 'recordupdateloop' end killvar 'current_record_update_count' killvar 'number_of_box_record_updates' end if $ARGS[0] = 'box_records': crossfit_record_it = 0 :recordgeneratorloop if crossfit_record_it < arrsize('$crossfit_wods'): $crossfit_wod = $crossfit_wods[crossfit_record_it] new_record_wod_time = max(1, (100 - (100 * (rand(40,100) + rand(0,100) + rand(0,100) + rand(0,100)) / 400))) if box_wod_record[$crossfit_wod] = 0 or box_wod_record[$crossfit_wod] > new_record_wod_time: box_wod_record[$crossfit_wod] = new_record_wod_time !! record holder changes only in 1/3rd of the cases from previous holder, or if sveta is record holder if rand(0, 2) = 0 OR $box_wod_record_holder[$crossfit_wod] = '' OR $box_wod_record_holder[$crossfit_wod] = $pcs_nickname: gs 'npcrnamefile', 'rusFemale' $box_wod_record_holder[$crossfit_wod] = $npctempgn[1] end end crossfit_record_it += 1 jump 'recordgeneratorloop' end killvar 'crossfit_record_it' killvar 'new_record_wod_time' killvar '$crossfit_wod' end --- havana_crossfit_funcs ---------------------------------