Skip to main content
replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
Source Link

GolfScript, 4 characters

I believe I win. ;)

Works with integer or decimal numbers of any length.

'-'/

Try it online

These programs do the same and are of equal length:

'-'-
'-'%

GolfScript (old version), 16 13

My first GS program! (that actually does somethingthat actually does something)

Doesn't work with decimal numbers because GolfScript doesn't have floating point.

~:$0<{0$-}$if

GolfScript, 4 characters

I believe I win. ;)

Works with integer or decimal numbers of any length.

'-'/

Try it online

These programs do the same and are of equal length:

'-'-
'-'%

GolfScript (old version), 16 13

My first GS program! (that actually does something)

Doesn't work with decimal numbers because GolfScript doesn't have floating point.

~:$0<{0$-}$if

GolfScript, 4 characters

I believe I win. ;)

Works with integer or decimal numbers of any length.

'-'/

Try it online

These programs do the same and are of equal length:

'-'-
'-'%

GolfScript (old version), 16 13

My first GS program! (that actually does something)

Doesn't work with decimal numbers because GolfScript doesn't have floating point.

~:$0<{0$-}$if
added 146 characters in body
Source Link
Doorknob
  • 71.8k
  • 20
  • 143
  • 385

GolfScript, 4 characters

I believe I win. ;)

Works with integer or decimal numbers of any length.

'-'/

Try it online

These programs do the same and are of equal length:

'-'-
'-'%

GolfScript (old version), 16 13

My first GS program! (that actually does something)

Doesn't work with decimal numbers because GolfScript doesn't have floating point.

~:$0<{0$-}$if

GolfScript, 4 characters

I believe I win. ;)

'-'/

Try it online

GolfScript (old version), 16 13

My first GS program! (that actually does something)

Doesn't work with decimal numbers because GolfScript doesn't have floating point.

~:$0<{0$-}$if

GolfScript, 4 characters

I believe I win. ;)

Works with integer or decimal numbers of any length.

'-'/

Try it online

These programs do the same and are of equal length:

'-'-
'-'%

GolfScript (old version), 16 13

My first GS program! (that actually does something)

Doesn't work with decimal numbers because GolfScript doesn't have floating point.

~:$0<{0$-}$if
added 119 characters in body
Source Link
Doorknob
  • 71.8k
  • 20
  • 143
  • 385

GolfScript, 4 characters

I believe I win. ;)

'-'/

Try it online

GolfScript (old version), 16 13

My first GS program! (that actually does something)

Doesn't work with decimal numbers because GolfScript doesn't have floating point.

~:$0<{0$-}$if

Old version:

~:a 0<{0a-}{a}if

GolfScript, 16 13

My first GS program! (that actually does something)

Doesn't work with decimal numbers because GolfScript doesn't have floating point.

~:$0<{0$-}$if

Old version:

~:a 0<{0a-}{a}if

GolfScript, 4 characters

I believe I win. ;)

'-'/

Try it online

GolfScript (old version), 16 13

My first GS program! (that actually does something)

Doesn't work with decimal numbers because GolfScript doesn't have floating point.

~:$0<{0$-}$if
added 85 characters in body
Source Link
Doorknob
  • 71.8k
  • 20
  • 143
  • 385
Loading
Source Link
Doorknob
  • 71.8k
  • 20
  • 143
  • 385
Loading