Skip to main content
Commonmark migration
Source Link

#GNU dc, 6 (3x2)

GNU dc, 6 (3x2)

I think this is the shortest answer not to require the "mod 90°" rule-relaxation:

3z1
0p2

Outputs 0, 1, 2 or 3 for each rotation.

For the 0, 2 and 3 rotations, the p simply pops and prints the last number literal to have been pushed to the stack. For the 1 rotation, the z pushes the current stack depth (1) to the stack, then the p pops and prints it.

#GNU dc, 6 (3x2)

I think this is the shortest answer not to require the "mod 90°" rule-relaxation:

3z1
0p2

Outputs 0, 1, 2 or 3 for each rotation.

For the 0, 2 and 3 rotations, the p simply pops and prints the last number literal to have been pushed to the stack. For the 1 rotation, the z pushes the current stack depth (1) to the stack, then the p pops and prints it.

GNU dc, 6 (3x2)

I think this is the shortest answer not to require the "mod 90°" rule-relaxation:

3z1
0p2

Outputs 0, 1, 2 or 3 for each rotation.

For the 0, 2 and 3 rotations, the p simply pops and prints the last number literal to have been pushed to the stack. For the 1 rotation, the z pushes the current stack depth (1) to the stack, then the p pops and prints it.

added 75 characters in body
Source Link
Digital Trauma
  • 73k
  • 9
  • 112
  • 264

#GNU dc, 6 (3x2)

I think this is the shortest answer not to require the "mod 90°" rule-relaxation:

3z1
0p2

Outputs 0, 1, 2 or 3 for each rotation.

For the 0, 2 and 3 rotations, the p simply pops and prints the last number literal to have been pushed to the stack. For the 1 rotation, the z pushes the current stack depth (1) to the stack, then the p pops and prints it.

#GNU dc, 6 (3x2)

3z1
0p2

Outputs 0, 1, 2 or 3 for each rotation.

For the 0, 2 and 3 rotations, the p simply pops and prints the last number literal to have been pushed to the stack. For the 1 rotation, the z pushes the current stack depth (1) to the stack, then the p pops and prints it.

#GNU dc, 6 (3x2)

I think this is the shortest answer not to require the "mod 90°" rule-relaxation:

3z1
0p2

Outputs 0, 1, 2 or 3 for each rotation.

For the 0, 2 and 3 rotations, the p simply pops and prints the last number literal to have been pushed to the stack. For the 1 rotation, the z pushes the current stack depth (1) to the stack, then the p pops and prints it.

added 252 characters in body
Source Link
Digital Trauma
  • 73k
  • 9
  • 112
  • 264

#GNU dc, 96 (3x33x2)

3 0
 p3z1
2 10p2

OrOutputs 0, 1, 2 or 3 for each rotation.

 1
0p2
 3 

For the 0, 2 and 3 rotations, the p simply pops and prints the last number literal to have been pushed to the stack. For the 1 rotation, the z pushes the current stack depth (1) to the stack, then the p pops and prints it.

#GNU dc, 9 (3x3)

3 0
 p
2 1

Or

 1
0p2
 3 

#GNU dc, 6 (3x2)

3z1
0p2

Outputs 0, 1, 2 or 3 for each rotation.

For the 0, 2 and 3 rotations, the p simply pops and prints the last number literal to have been pushed to the stack. For the 1 rotation, the z pushes the current stack depth (1) to the stack, then the p pops and prints it.

Source Link
Digital Trauma
  • 73k
  • 9
  • 112
  • 264
Loading