Skip to main content
Commonmark migration
Source Link

Write the shortest program possible that traps the mouse cursor inside an upward pointing equilateral triangle with a side length of 274 pixels and a centroid at the exact middle of the screen.
(Triangle because of cheese wedges.)

While your program is running, the tip of the cursor should never be able to move outside of this triangle, and should move and function normally inside. When the Esc key is hit the program must end, releasing the mouse.

Scoring

#Scoring ThisThis is code-golf, the shortest code in bytes wins. You may only use standard ASCII.

#Details

Details

  • Besides things like shutting off the computer or killing the process or pressing Alt-F4 or Ctrl-Alt-Delete, the only way to release the cursor should be the Esc key.
  • If the cursor is outside the triangle when the program starts it should be placed somewhere inside.
  • The cursor must be able to move smoothly up and down the two angled sides of the triangles.
  • If the display is extended over multiple monitors the triangle may appear in the center of any one monitor or the center of all of them combined. (If you only have one monitor you do not need to test for this.)
  • It's fine if touchscreen users can still click things outside the triangle.

Tiny bonus question: Where did I get 274 from?

Write the shortest program possible that traps the mouse cursor inside an upward pointing equilateral triangle with a side length of 274 pixels and a centroid at the exact middle of the screen.
(Triangle because of cheese wedges.)

While your program is running, the tip of the cursor should never be able to move outside of this triangle, and should move and function normally inside. When the Esc key is hit the program must end, releasing the mouse.

#Scoring This is code-golf, the shortest code in bytes wins. You may only use standard ASCII.

#Details

  • Besides things like shutting off the computer or killing the process or pressing Alt-F4 or Ctrl-Alt-Delete, the only way to release the cursor should be the Esc key.
  • If the cursor is outside the triangle when the program starts it should be placed somewhere inside.
  • The cursor must be able to move smoothly up and down the two angled sides of the triangles.
  • If the display is extended over multiple monitors the triangle may appear in the center of any one monitor or the center of all of them combined. (If you only have one monitor you do not need to test for this.)
  • It's fine if touchscreen users can still click things outside the triangle.

Tiny bonus question: Where did I get 274 from?

Write the shortest program possible that traps the mouse cursor inside an upward pointing equilateral triangle with a side length of 274 pixels and a centroid at the exact middle of the screen.
(Triangle because of cheese wedges.)

While your program is running, the tip of the cursor should never be able to move outside of this triangle, and should move and function normally inside. When the Esc key is hit the program must end, releasing the mouse.

Scoring

This is code-golf, the shortest code in bytes wins. You may only use standard ASCII.

Details

  • Besides things like shutting off the computer or killing the process or pressing Alt-F4 or Ctrl-Alt-Delete, the only way to release the cursor should be the Esc key.
  • If the cursor is outside the triangle when the program starts it should be placed somewhere inside.
  • The cursor must be able to move smoothly up and down the two angled sides of the triangles.
  • If the display is extended over multiple monitors the triangle may appear in the center of any one monitor or the center of all of them combined. (If you only have one monitor you do not need to test for this.)
  • It's fine if touchscreen users can still click things outside the triangle.

Tiny bonus question: Where did I get 274 from?

Tweeted twitter.com/#!/StackCodeGolf/status/495145997941878784
clarified that only the cursor tip is trapped
Source Link
Calvin's Hobbies
  • 90k
  • 46
  • 339
  • 555

Write the shortest program possible that traps the mouse cursor inside an upward pointing equilateral triangle with a side length of 274 pixels and a centroid at the exact middle of the screen.
(Triangle because of cheese wedges.)

While your program is running, the tip of the cursor should never be able to move outside of this triangle, and should move and function normally inside. When the Esc key is hit the program must end, releasing the mouse.

#Scoring This is code-golf, the shortest code in bytes wins. You may only use standard ASCII.

#Details

  • Besides things like shutting off the computer or killing the process or pressing Alt-F4 or Ctrl-Alt-Delete, the only way to release the cursor should be the Esc key.
  • If the cursor is outside the triangle when the program starts it should be placed somewhere inside.
  • The cursor must be able to move smoothly up and down the two angled sides of the triangles.
  • If the display is extended over multiple monitors the triangle may appear in the center of any one monitor or the center of all of them combined. (If you only have one monitor you do not need to test for this.)
  • It's fine if touchscreen users can still click things outside the triangle.

Tiny bonus question: Where did I get 274 from?

Write the shortest program possible that traps the mouse cursor inside an upward pointing equilateral triangle with a side length of 274 pixels and a centroid at the exact middle of the screen.
(Triangle because of cheese wedges.)

While your program is running, the cursor should never be able to move outside of this triangle, and should move and function normally inside. When the Esc key is hit the program must end, releasing the mouse.

#Scoring This is code-golf, the shortest code in bytes wins. You may only use standard ASCII.

#Details

  • Besides things like shutting off the computer or killing the process or pressing Alt-F4 or Ctrl-Alt-Delete, the only way to release the cursor should be the Esc key.
  • If the cursor is outside the triangle when the program starts it should be placed somewhere inside.
  • The cursor must be able to move smoothly up and down the two angled sides of the triangles.
  • If the display is extended over multiple monitors the triangle may appear in the center of any one monitor or the center of all of them combined. (If you only have one monitor you do not need to test for this.)
  • It's fine if touchscreen users can still click things outside the triangle.

Tiny bonus question: Where did I get 274 from?

Write the shortest program possible that traps the mouse cursor inside an upward pointing equilateral triangle with a side length of 274 pixels and a centroid at the exact middle of the screen.
(Triangle because of cheese wedges.)

While your program is running, the tip of the cursor should never be able to move outside of this triangle, and should move and function normally inside. When the Esc key is hit the program must end, releasing the mouse.

#Scoring This is code-golf, the shortest code in bytes wins. You may only use standard ASCII.

#Details

  • Besides things like shutting off the computer or killing the process or pressing Alt-F4 or Ctrl-Alt-Delete, the only way to release the cursor should be the Esc key.
  • If the cursor is outside the triangle when the program starts it should be placed somewhere inside.
  • The cursor must be able to move smoothly up and down the two angled sides of the triangles.
  • If the display is extended over multiple monitors the triangle may appear in the center of any one monitor or the center of all of them combined. (If you only have one monitor you do not need to test for this.)
  • It's fine if touchscreen users can still click things outside the triangle.

Tiny bonus question: Where did I get 274 from?

Source Link
Calvin's Hobbies
  • 90k
  • 46
  • 339
  • 555

Trap the mouse!

Write the shortest program possible that traps the mouse cursor inside an upward pointing equilateral triangle with a side length of 274 pixels and a centroid at the exact middle of the screen.
(Triangle because of cheese wedges.)

While your program is running, the cursor should never be able to move outside of this triangle, and should move and function normally inside. When the Esc key is hit the program must end, releasing the mouse.

#Scoring This is code-golf, the shortest code in bytes wins. You may only use standard ASCII.

#Details

  • Besides things like shutting off the computer or killing the process or pressing Alt-F4 or Ctrl-Alt-Delete, the only way to release the cursor should be the Esc key.
  • If the cursor is outside the triangle when the program starts it should be placed somewhere inside.
  • The cursor must be able to move smoothly up and down the two angled sides of the triangles.
  • If the display is extended over multiple monitors the triangle may appear in the center of any one monitor or the center of all of them combined. (If you only have one monitor you do not need to test for this.)
  • It's fine if touchscreen users can still click things outside the triangle.

Tiny bonus question: Where did I get 274 from?