2 code improvement
source | link

Perl 5, 2828 25 bytes

 

-3 bytes thanks to @neil!

$a++;print"\e[D$a"ifprint"\e[D$a"if($a++$a!=2);

Moves the cursor backwards (does nothing on start of line) and prints the value of $a, first and third time (i.e., the third time a 1 is printed, the cursor moves, and a 3 is printed on the position of the 1).

Perl 5, 28 bytes

 
$a++;print"\e[D$a"if($a!=2);

Moves the cursor backwards (does nothing on start of line) and prints the value of $a, first and third time (i.e., the third time a 1 is printed, the cursor moves, and a 3 is printed on the position of the 1).

Perl 5, 28 25 bytes

-3 bytes thanks to @neil!

print"\e[D$a"if(++$a!=2);

Moves the cursor backwards (does nothing on start of line) and prints the value of $a, first and third time (i.e., the third time a 1 is printed, the cursor moves, and a 3 is printed on the position of the 1).

1
source | link

Perl 5, 28 bytes

$a++;print"\e[D$a"if($a!=2);

Moves the cursor backwards (does nothing on start of line) and prints the value of $a, first and third time (i.e., the third time a 1 is printed, the cursor moves, and a 3 is printed on the position of the 1).