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

Commonmark migration
Source Link

#Octave, 43 bytes (Safe)

Octave, 43 bytes (Safe)

$'()*+,-/23579:[]aelnouv'*,-23:[]lu',-23]',

This is a script that requires input from the command line (it's not a function). It's floating point accuracy (so no rounding).

Solution:

eval(-[5,-2:3,-3:2]+['nlouu*$$',39,']2/7'])

Explanation:

eval( <string> ) % Evaluated the string inside the brackets and executes it
Everything inside the eval call gets evaluated to input('')^2.5

How?

-[5,-2:3,-3:2] % A vector: [-5, 2, 1, 0, -1, -2, -3, 3, 2, 1, 0, -1, -2]
['nlouu**$$',39,']2/7'] % This is a string: nlouu**$ concatenated with the number
. % 39 (ASCII ']'), and ']2/7'. Thus, combined: 'nlouu**$$']2/7'

Adding the first vector to this string will convert it to the integer vector:
[105, 110, 112, 117, 116, 40, 39, 39, 41, 94, 50, 46, 53]

eval implicitly converts this to a string, and these numbers just so happens to be: input('')^2.5

#Octave, 43 bytes (Safe)

$'()*+,-/23579:[]aelnouv'*,-23:[]lu',-23]',

This is a script that requires input from the command line (it's not a function). It's floating point accuracy (so no rounding).

Solution:

eval(-[5,-2:3,-3:2]+['nlouu*$$',39,']2/7'])

Explanation:

eval( <string> ) % Evaluated the string inside the brackets and executes it
Everything inside the eval call gets evaluated to input('')^2.5

How?

-[5,-2:3,-3:2] % A vector: [-5, 2, 1, 0, -1, -2, -3, 3, 2, 1, 0, -1, -2]
['nlouu**$$',39,']2/7'] % This is a string: nlouu**$ concatenated with the number
. % 39 (ASCII ']'), and ']2/7'. Thus, combined: 'nlouu**$$']2/7'

Adding the first vector to this string will convert it to the integer vector:
[105, 110, 112, 117, 116, 40, 39, 39, 41, 94, 50, 46, 53]

eval implicitly converts this to a string, and these numbers just so happens to be: input('')^2.5

Octave, 43 bytes (Safe)

$'()*+,-/23579:[]aelnouv'*,-23:[]lu',-23]',

This is a script that requires input from the command line (it's not a function). It's floating point accuracy (so no rounding).

Solution:

eval(-[5,-2:3,-3:2]+['nlouu*$$',39,']2/7'])

Explanation:

eval( <string> ) % Evaluated the string inside the brackets and executes it
Everything inside the eval call gets evaluated to input('')^2.5

How?

-[5,-2:3,-3:2] % A vector: [-5, 2, 1, 0, -1, -2, -3, 3, 2, 1, 0, -1, -2]
['nlouu**$$',39,']2/7'] % This is a string: nlouu**$ concatenated with the number
. % 39 (ASCII ']'), and ']2/7'. Thus, combined: 'nlouu**$$']2/7'

Adding the first vector to this string will convert it to the integer vector:
[105, 110, 112, 117, 116, 40, 39, 39, 41, 94, 50, 46, 53]

eval implicitly converts this to a string, and these numbers just so happens to be: input('')^2.5

added 9 characters in body
Source Link
Stewie Griffin
  • 46.8k
  • 16
  • 137
  • 304

#Octave, 43 bytes (Safe)

$'()*+,-/23579:[]aelnouv'*,-23:[]lu',-23]',

This is a script that requires input from the command line (it's not a function). It's floating point accuracy (so no rounding).

Solution:

eval(-[5,-2:3,-3:2]+['nlouu**$$'2]+['nlouu*$$',39,']2/7'])

Explanation:

eval( <string> ) % Evaluated the string inside the brackets and executes it
Everything inside the eval call gets evaluated to input('')^2.5

How?

-[5,-2:3,-3:2] % A vector: [-5, 2, 1, 0, -1, -2, -3, 3, 2, 1, 0, -1, -2]
['nlouu**$$',39,']2/7'] % This is a string: nlouu**$ concatenated with the number
. % 39 (ASCII ']'), and ']2/7'. Thus, combined: 'nlouu**$$']2/7'

Adding the first vector to this string will convert it to the integer vector:
[105, 110, 112, 117, 116, 40, 39, 39, 41, 94, 50, 46, 53]

eval implicitly converts this to a string, and these numbers just so happens to be: input('')^2.5

#Octave, 43 bytes (Safe)

$'()*+,-/23579:[]aelnouv'*,-23:[]lu',-23]',

This is a script that requires input from the command line (it's not a function). It's floating point accuracy (so no rounding).

Solution:

eval(-[5,-2:3,-3:2]+['nlouu**$$',39,']2/7'])

Explanation:

eval( <string> ) % Evaluated the string inside the brackets and executes it
Everything inside the eval call gets evaluated to input('')^2.5

How?

-[5,-2:3,-3:2] % A vector: [-5, 2, 1, 0, -1, -2, -3, 3, 2, 1, 0, -1, -2]
['nlouu**$$',39,']2/7'] % This is a string: nlouu**$ concatenated with the number
. % 39 (ASCII ']'), and ']2/7'. Thus, combined: 'nlouu**$$']2/7'

Adding the first vector to this string will convert it to the integer vector:
[105, 110, 112, 117, 116, 40, 39, 39, 41, 94, 50, 46, 53]

eval implicitly converts this to a string, and these numbers just so happens to be: input('')^2.5

#Octave, 43 bytes (Safe)

$'()*+,-/23579:[]aelnouv'*,-23:[]lu',-23]',

This is a script that requires input from the command line (it's not a function). It's floating point accuracy (so no rounding).

Solution:

eval(-[5,-2:3,-3:2]+['nlouu*$$',39,']2/7'])

Explanation:

eval( <string> ) % Evaluated the string inside the brackets and executes it
Everything inside the eval call gets evaluated to input('')^2.5

How?

-[5,-2:3,-3:2] % A vector: [-5, 2, 1, 0, -1, -2, -3, 3, 2, 1, 0, -1, -2]
['nlouu**$$',39,']2/7'] % This is a string: nlouu**$ concatenated with the number
. % 39 (ASCII ']'), and ']2/7'. Thus, combined: 'nlouu**$$']2/7'

Adding the first vector to this string will convert it to the integer vector:
[105, 110, 112, 117, 116, 40, 39, 39, 41, 94, 50, 46, 53]

eval implicitly converts this to a string, and these numbers just so happens to be: input('')^2.5

Added solution and explanation.
Source Link
Stewie Griffin
  • 46.8k
  • 16
  • 137
  • 304

#Octave, 43 bytes (Safe)

$'()*+,-/23579:[]aelnouv'*,-23:[]lu',-23]',

This is a script that requires input from the command line (it's not a function). It's floating point accuracy (so no rounding).

Solution:

eval(-[5,-2:3,-3:2]+['nlouu**$$',39,']2/7'])

Explanation:

eval( <string> ) % Evaluated the string inside the brackets and executes it
Everything inside the eval call gets evaluated to input('')^2.5

How?

-[5,-2:3,-3:2] % A vector: [-5, 2, 1, 0, -1, -2, -3, 3, 2, 1, 0, -1, -2]
['nlouu**$$',39,']2/7'] % This is a string: nlouu**$ concatenated with the number
. % 39 (ASCII ']'), and ']2/7'. Thus, combined: 'nlouu**$$']2/7'

Adding the first vector to this string will convert it to the integer vector:
[105, 110, 112, 117, 116, 40, 39, 39, 41, 94, 50, 46, 53]

eval implicitly converts this to a string, and these numbers just so happens to be: input('')^2.5

#Octave, 43 bytes (Safe)

$'()*+,-/23579:[]aelnouv'*,-23:[]lu',-23]',

This is a script that requires input from the command line (it's not a function). It's floating point accuracy (so no rounding).

#Octave, 43 bytes (Safe)

$'()*+,-/23579:[]aelnouv'*,-23:[]lu',-23]',

This is a script that requires input from the command line (it's not a function). It's floating point accuracy (so no rounding).

Solution:

eval(-[5,-2:3,-3:2]+['nlouu**$$',39,']2/7'])

Explanation:

eval( <string> ) % Evaluated the string inside the brackets and executes it
Everything inside the eval call gets evaluated to input('')^2.5

How?

-[5,-2:3,-3:2] % A vector: [-5, 2, 1, 0, -1, -2, -3, 3, 2, 1, 0, -1, -2]
['nlouu**$$',39,']2/7'] % This is a string: nlouu**$ concatenated with the number
. % 39 (ASCII ']'), and ']2/7'. Thus, combined: 'nlouu**$$']2/7'

Adding the first vector to this string will convert it to the integer vector:
[105, 110, 112, 117, 116, 40, 39, 39, 41, 94, 50, 46, 53]

eval implicitly converts this to a string, and these numbers just so happens to be: input('')^2.5

added 6 characters in body
Source Link
Mr. Xcoder
  • 42.9k
  • 9
  • 87
  • 221
Loading
deleted 10 characters in body
Source Link
Stewie Griffin
  • 46.8k
  • 16
  • 137
  • 304
Loading
Source Link
Stewie Griffin
  • 46.8k
  • 16
  • 137
  • 304
Loading

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