Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

added 3 characters in body; deleted 1 character in body
Source Link
RGS
  • 14.2k
  • 1
  • 62
  • 117

Mathematica, (削除) 17 (削除ここまで) 14(削除) 14 (削除ここまで) 13 bytes / 12(削除) 12 (削除ここまで) 7 characters

Round[#⌊#/√2]&√2⌋&

Try it online

-3 bytes because Mathematica accepts the char √, which I copied from this MathGolf answer.

-1 byte, -5 characters, as per @Mark S. suggestedsuggestion, by using ⌊⌋.

⌊#/√2⌋&

to save 1For just one more byte and(but 5 more characters, but this no longer rounds) I can always round to the nearest integer, as it always rounds down. A similar program can be made to always round up. with

Round[#/√2]&

Mathematica, (削除) 17 (削除ここまで) 14 bytes / 12 characters

Round[#/√2]&

Try it online

-3 bytes because Mathematica accepts the char √, which I copied from this MathGolf answer.

@Mark S. suggested

⌊#/√2⌋&

to save 1 byte and 5 characters, but this no longer rounds to the nearest integer, as it always rounds down. A similar program can be made to always round up.

Mathematica, (削除) 17 (削除ここまで) (削除) 14 (削除ここまで) 13 bytes / (削除) 12 (削除ここまで) 7 characters

⌊#/√2⌋&

Try it online

-3 bytes because Mathematica accepts the char √, which I copied from this MathGolf answer.

-1 byte, -5 characters, as per @Mark S. suggestion, by using ⌊⌋.

For just one more byte (but 5 more characters) I can always round to the nearest integer with

Round[#/√2]&
added 193 characters in body
Source Link
RGS
  • 14.2k
  • 1
  • 62
  • 117

Mathematica, (削除) 17 (削除ここまで) 14 bytes / 12 characters

Round[#/√2]&

Try it online

-3 bytes because Mathematica accepts the char √, which I copied from this MathGolf answer.

@Mark S. suggested

⌊#/√2⌋&

to save 1 byte and 5 characters, but this no longer rounds to the nearest integer, as it always rounds down. A similar program can be made to always round up.

Mathematica, (削除) 17 (削除ここまで) 14 bytes / 12 characters

Round[#/√2]&

Try it online

-3 bytes because Mathematica accepts the char √, which I copied from this MathGolf answer.

Mathematica, (削除) 17 (削除ここまで) 14 bytes / 12 characters

Round[#/√2]&

Try it online

-3 bytes because Mathematica accepts the char √, which I copied from this MathGolf answer.

@Mark S. suggested

⌊#/√2⌋&

to save 1 byte and 5 characters, but this no longer rounds to the nearest integer, as it always rounds down. A similar program can be made to always round up.

deleted 4 characters in body
Source Link
RGS
  • 14.2k
  • 1
  • 62
  • 117

Mathematica, (削除) 17 (削除ここまで) 14 bytes (but/ 12 chars :'( )characters

Round[#/√2]&

Try it online

-3 bytes because Mathematica accepts the char √, which I copied from this MathGolf answer.

Mathematica, (削除) 17 (削除ここまで) 14 bytes (but 12 chars :'( )

Round[#/√2]&

Try it online

-3 bytes because Mathematica accepts the char √, which I copied from this MathGolf answer.

Mathematica, (削除) 17 (削除ここまで) 14 bytes / 12 characters

Round[#/√2]&

Try it online

-3 bytes because Mathematica accepts the char √, which I copied from this MathGolf answer.

deleted 9 characters in body; added 30 characters in body; added 105 characters in body; added 49 characters in body
Source Link
RGS
  • 14.2k
  • 1
  • 62
  • 117
Loading
Source Link
RGS
  • 14.2k
  • 1
  • 62
  • 117
Loading

AltStyle によって変換されたページ (->オリジナル) /