Skip to main content
Commonmark migration
Source Link

To each of these nine confusingly similar words, assign a number 1-9 in any way you like:

though
through
thorough
Thoreau
throw
threw
trough
tough
troll

Write a program that takes in a string. If the input is one of these nine words, output the number you assigned to it. If the input is not one of the words above, the program may do anything (including error or loop forever).

The words are case sensitive, e.g. Thoreau, should produce a number from 1-9 but thoreau will not necessarily do the same.

##Example

Example

Suppose you assign the numbers as follows:

though   9
through  2
thorough 7
Thoreau  6
throw    3
threw    5
trough   4
tough    1
troll    8

Then when tough is input, 1 should be output.
When through is input, 2 should be output.
When throw is input, 3 should be output.
. . .
When though is input, 9 should be output.

All other inputs may do anything.

##Details

Details

  • Take the input string via stdin or the command line and output to stdout.
  • The output may contain a single trailing newline.
  • Instead of a program, you may write a function that takes in a string and prints the result normally or returns it.
  • The shortest submission in bytes wins.

To each of these nine confusingly similar words, assign a number 1-9 in any way you like:

though
through
thorough
Thoreau
throw
threw
trough
tough
troll

Write a program that takes in a string. If the input is one of these nine words, output the number you assigned to it. If the input is not one of the words above, the program may do anything (including error or loop forever).

The words are case sensitive, e.g. Thoreau, should produce a number from 1-9 but thoreau will not necessarily do the same.

##Example

Suppose you assign the numbers as follows:

though   9
through  2
thorough 7
Thoreau  6
throw    3
threw    5
trough   4
tough    1
troll    8

Then when tough is input, 1 should be output.
When through is input, 2 should be output.
When throw is input, 3 should be output.
. . .
When though is input, 9 should be output.

All other inputs may do anything.

##Details

  • Take the input string via stdin or the command line and output to stdout.
  • The output may contain a single trailing newline.
  • Instead of a program, you may write a function that takes in a string and prints the result normally or returns it.
  • The shortest submission in bytes wins.

To each of these nine confusingly similar words, assign a number 1-9 in any way you like:

though
through
thorough
Thoreau
throw
threw
trough
tough
troll

Write a program that takes in a string. If the input is one of these nine words, output the number you assigned to it. If the input is not one of the words above, the program may do anything (including error or loop forever).

The words are case sensitive, e.g. Thoreau, should produce a number from 1-9 but thoreau will not necessarily do the same.

Example

Suppose you assign the numbers as follows:

though   9
through  2
thorough 7
Thoreau  6
throw    3
threw    5
trough   4
tough    1
troll    8

Then when tough is input, 1 should be output.
When through is input, 2 should be output.
When throw is input, 3 should be output.
. . .
When though is input, 9 should be output.

All other inputs may do anything.

Details

  • Take the input string via stdin or the command line and output to stdout.
  • The output may contain a single trailing newline.
  • Instead of a program, you may write a function that takes in a string and prints the result normally or returns it.
  • The shortest submission in bytes wins.
added 29 characters in body
Source Link
Calvin's Hobbies
  • 90k
  • 46
  • 339
  • 555

To each of these nine confusingly similar words, assign a number 1-9 in any way you like:

though
through
thorough
Thoreau
throw
threw
trough
tough
troll

Write a program that takes in a string. If the input is one of these nine words, output the number you assigned to it. If the input is not one of the words above, the program may do anything (including error or loop forever).

The words are case sensitive, e.g. Thoreau, should produce a number from 1-9 but thoreau will not necessarily do the same.

##Example

Suppose you assign the numbers as follows:

though   9
through  2
thorough 7
Thoreau  6
throw    3
threw    5
trough   4
tough    1
troll    8

Then when tough is input, 1 should be output.
When through is input, 2 should be output.
When throw is input, 3 should be output.
. . .
When though is input, 9 should be output.

All other inputs may do anything.

##Details

  • Take the input string via stdin or the command line and output to stdout.
  • The output may contain a single trailing newline.
  • Instead of a program, you may write a function that takes in a string and prints the result normally or returns it.
  • The shortest submission in bytes wins.

To each of these nine confusingly similar words, assign a number 1-9 in any way you like:

though
through
thorough
Thoreau
throw
threw
trough
tough
troll

Write a program that takes in a string. If the input is one of these nine words, output the number you assigned to it. If the input is not one of the words above, the program may do anything (including error or loop forever).

The words are case sensitive, e.g. Thoreau, should produce a number from 1-9 but thoreau will not necessarily do the same.

##Example

Suppose you assign the numbers as follows:

though   9
through  2
thorough 7
Thoreau  6
throw    3
threw    5
trough   4
tough    1
troll    8

Then when tough is input, 1 should be output.
When through is input, 2 should be output.
When throw is input, 3 should be output.
. . .
When though is input, 9 should be output.

All other inputs may do anything.

##Details

  • Take the input string via stdin or the command line and output to stdout.
  • The output may contain a single trailing newline.
  • Instead of a program, you may write a function that takes in a string and prints the result normally or returns it.
  • The shortest submission in bytes wins.

To each of these nine confusingly similar words, assign a number 1-9 in any way you like:

though
through
thorough
Thoreau
throw
threw
trough
tough
troll

Write a program that takes in a string. If the input is one of these nine words, output the number you assigned to it. If the input is not one of the words above, the program may do anything (including error or loop forever).

The words are case sensitive, e.g. Thoreau, should produce a number from 1-9 but thoreau will not necessarily do the same.

##Example

Suppose you assign the numbers as follows:

though   9
through  2
thorough 7
Thoreau  6
throw    3
threw    5
trough   4
tough    1
troll    8

Then when tough is input, 1 should be output.
When through is input, 2 should be output.
When throw is input, 3 should be output.
. . .
When though is input, 9 should be output.

All other inputs may do anything.

##Details

  • Take the input string via stdin or the command line and output to stdout.
  • The output may contain a single trailing newline.
  • Instead of a program, you may write a function that takes in a string and prints the result normally or returns it.
  • The shortest submission in bytes wins.
Tweeted twitter.com/#!/StackCodeGolf/status/600157253853904896
deleted 151 characters in body
Source Link
Calvin's Hobbies
  • 90k
  • 46
  • 339
  • 555

To each of these nine confusingly similar words, assign a number 1-9 in any way you like:

though
through
thorough
Thoreau
throw
threw
trough
tough
troll

Write a program that takes in a non-empty string consisting of any uppercase and lowercase letters (A-Z a-z). If the input is one of thethese nine words listed above, output the number you assigned to it. If the input is not one of the words above, outputthe program may do anything 0(including error or loop forever).

The words are case sensitive, e.g. thoreau, ThrowThoreau, and THROW should all produce a number from 1-9 but 0thoreau will not necessarily do the same.

##Example

Suppose you assign the numbers as follows:

though   9
through  2
thorough 7
Thoreau  6
throw    3
threw    5
trough   4
tough    1
troll    8

Then when tough is input, 1 should be output.
When through is input, 2 should be output.
When throw is input, 3 should be output.
. . .
When though is input, 9 should be output.

If anyAll other string is input, 0 should be outputinputs may do anything.

##Details

  • Take the input string via stdin or the command line and output to stdout.
  • You may assume the input is a non-empty string consisting only of letters.
  • The output may contain a single trailing newline.
  • Instead of a program, you may write a function that takes in a string and prints the result normally or returns it.
  • The shortest submission in bytes wins.

To each of these nine confusingly similar words, assign a number 1-9 in any way you like:

though
through
thorough
Thoreau
throw
threw
trough
tough
troll

Write a program that takes in a non-empty string consisting of any uppercase and lowercase letters (A-Z a-z). If the input is one of the nine words listed above, output the number you assigned to it. If the input is not one of the words above, output 0.

The words are case sensitive, e.g. thoreau, Throw, and THROW should all produce 0.

##Example

Suppose you assign the numbers as follows:

though   9
through  2
thorough 7
Thoreau  6
throw    3
threw    5
trough   4
tough    1
troll    8

Then when tough is input, 1 should be output.
When through is input, 2 should be output.
When throw is input, 3 should be output.
. . .
When though is input, 9 should be output.

If any other string is input, 0 should be output.

##Details

  • Take the input string via stdin or the command line and output to stdout.
  • You may assume the input is a non-empty string consisting only of letters.
  • The output may contain a single trailing newline.
  • Instead of a program, you may write a function that takes in a string and prints the result normally or returns it.
  • The shortest submission in bytes wins.

To each of these nine confusingly similar words, assign a number 1-9 in any way you like:

though
through
thorough
Thoreau
throw
threw
trough
tough
troll

Write a program that takes in a string. If the input is one of these nine words, output the number you assigned to it. If the input is not one of the words above, the program may do anything (including error or loop forever).

The words are case sensitive, e.g. Thoreau, should produce a number from 1-9 but thoreau will not necessarily do the same.

##Example

Suppose you assign the numbers as follows:

though   9
through  2
thorough 7
Thoreau  6
throw    3
threw    5
trough   4
tough    1
troll    8

Then when tough is input, 1 should be output.
When through is input, 2 should be output.
When throw is input, 3 should be output.
. . .
When though is input, 9 should be output.

All other inputs may do anything.

##Details

  • Take the input string via stdin or the command line and output to stdout.
  • The output may contain a single trailing newline.
  • Instead of a program, you may write a function that takes in a string and prints the result normally or returns it.
  • The shortest submission in bytes wins.
added 12 characters in body; edited title
Source Link
Calvin's Hobbies
  • 90k
  • 46
  • 339
  • 555
Loading
Source Link
Calvin's Hobbies
  • 90k
  • 46
  • 339
  • 555
Loading