# input reading elided my %swap=( 'jmp' => 'nop', 'nop' => 'jmp' ); # Part 1: my ( $p1_r, $p1_a ) = runcomp(); print "Part 1: $p1_r $p1_a\n"; for( my $ct=0; $ct < $psize ; $ct++ ) { my $old_instr = $ins[$ct]; if( exists( $swap{$old_instr} ) ) { my $new_instr = $swap{$old_instr}; $ins[$ct]=$new_instr; my ( $ret, $acc ) = runcomp(); if( $ret eq "bounds" ) { print "Part 2: Replacing $ct ($old_instr) with $new_instr return bounds error with acc=$acc\n"; } $ins[$ct]=$old_instr; } } # runcomp function elided too
@Greenbank started
London Fixed Gear and Single-Speed is a community of predominantly fixed gear and single-speed cyclists in and around London, UK.
This site is supported almost exclusively by donations. Please consider donating a small amount regularly.