Skip to main content

Scala REPL

Scala, 32 29 bytes

+"Happy new year to you!".sum 

34 29 characters.Try it online!

+"Happy new year to you!".sum 

Well ok if you really want it golfed with any chars, you can use:

'@'*' '-'"' 

Scala, 11 bytes

'@'*' '-'"' 

orTry it online!

"{yz}"map(_-'I'toChar) 

Scala, 22 bytes

"{yz}"map(_-'I'toChar) 

which have 11 and 22 chars respectively.Try it online!

Scala REPL

34 29 characters.

+"Happy new year to you!".sum 

Well ok if you really want it golfed with any chars, you can use:

'@'*' '-'"' 

or

"{yz}"map(_-'I'toChar) 

which have 11 and 22 chars respectively.

Scala, 32 29 bytes

+"Happy new year to you!".sum 

Try it online!

Well ok if you really want it golfed with any chars, you can use:

Scala, 11 bytes

'@'*' '-'"' 

Try it online!

Scala, 22 bytes

"{yz}"map(_-'I'toChar) 

Try it online!

shorter solution.
Source Link
Mikaël Mayer
  • 1.9k
  • 13
  • 13

Scala REPL

3434 29 characters. Not the shortest. toInt is required to print the value of the char.

"Happy+"Happy new year to you!".sum.toInt 

Well ok if you really want it golfed with any chars, you can use:

'@'*' '-'"' 

or

"{yz}".map"map(_-'I'toChar) 

which have 11 and 2322 chars respectively.

Scala REPL

34 characters. Not the shortest. toInt is required to print the value of the char.

"Happy new year to you!".sum.toInt 

Well ok if you really want it golfed with any chars, you can use:

'@'*' '-'"' 

or

"{yz}".map(_-'I'toChar) 

which have 11 and 23 chars respectively.

Scala REPL

34 29 characters.

+"Happy new year to you!".sum 

Well ok if you really want it golfed with any chars, you can use:

'@'*' '-'"' 

or

"{yz}"map(_-'I'toChar) 

which have 11 and 22 chars respectively.

one more formula.and corrected the rest.
Source Link
Mikaël Mayer
  • 1.9k
  • 13
  • 13

Scala REPL

34 characters. Not the shortest. toInt is required to print the value of the char.

"Happy new year to you!".sum.toInt 

Well ok if you really want it golfed with any chars, you can use:

'@'*' '-'"' 

or

"{yz}".map(_-'I'toChar) 

which ishave 11 chars long and looks nice23 chars respectively.

Scala REPL

34 characters. Not the shortest. toInt is required to print the value of the char.

"Happy new year to you!".sum.toInt 

Well ok if you really want it golfed with any chars, you can use:

'@'*' '-'"' 

which is 11 chars long and looks nice.

Scala REPL

34 characters. Not the shortest. toInt is required to print the value of the char.

"Happy new year to you!".sum.toInt 

Well ok if you really want it golfed with any chars, you can use:

'@'*' '-'"' 

or

"{yz}".map(_-'I'toChar) 

which have 11 and 23 chars respectively.

added shorter version.
Source Link
Mikaël Mayer
  • 1.9k
  • 13
  • 13
Loading
Source Link
Mikaël Mayer
  • 1.9k
  • 13
  • 13
Loading