Skip to main content
deleted 109 characters in body
Source Link
xnor
  • 149.7k
  • 3
  • 94
  • 133

Underfull \hbox (badness 10000)

Every TeX user has been warned many times that their hboxes are terribly underfull or overfull. So much badness! This challenge is to rate how badly underfull or overfull a line of text is for a simplified line wrapper.

Task

You're given a space-separated string or list of words made of letters a-zA-Z. Output the minimal badness achievable for the first line.

The text needs to be wrapped on a line that's 10 characters wide, but it can only be split on spaces, no in the middle of words. Any letter that spills beyond the width counts for 1000 overfull badness each, and each leftover empty position at the end of the line counts for 1000 underfull badness.

ExamplesExample

For input Overfull"Overfull hboxhbox", we can keep the word "hbox" in the first line for 3000 overfull badness, or wrap it to the second line for 2000 underfull badness which is smaller, so the output is 2000.

0123456789 Overfull hbox ^^^ Overfull hbox ^^ 

Note that we don't care about badness of the second line.

ForDetails

The input is a space-separated string or a list of words made of letters Supercalifragilisticexpialidociousa-zA-Z. It won't have any words more than 10 letters long, we can't do anything putor be more than 20 characters in on one line for badness 24000total. It won't be empty or have any zero-length words.

Test cases

TODO


Sandbox: Is it OK to have a multiplier of 1000 for theme? Should the underfull and overfull badness penalties be different, like 1000 vs 2000?

Underfull \hbox (badness 10000)

Every TeX user has been warned many times that their hboxes are terribly underfull or overfull. So much badness! This challenge is to rate how badly underfull or overfull a line of text is for a simplified line wrapper.

Task

You're given a space-separated string or list of words made of letters a-zA-Z. Output the minimal badness achievable for the first line.

The text needs to be wrapped on a line that's 10 characters wide, but it can only be split on spaces, no in the middle of words. Any letter that spills beyond the width counts for 1000 overfull badness each, and each leftover empty position at the end of the line counts for 1000 underfull badness.

Examples

For input Overfull hbox, we can keep the word "hbox" in the first line for 3000 overfull badness, or wrap it to the second line for 2000 underfull badness which is smaller, so the output is 2000.

0123456789 Overfull hbox ^^^ Overfull hbox ^^ 

Note that we don't care about badness of the second line.

For input Supercalifragilisticexpialidocious, we can't do anything put in on one line for badness 24000.

Test cases

TODO


Sandbox: Is it OK to have a multiplier of 1000 for theme? Should the underfull and overfull badness penalties be different, like 1000 vs 2000?

Underfull \hbox (badness 10000)

Every TeX user has been warned many times that their hboxes are terribly underfull or overfull. So much badness! This challenge is to rate how badly underfull or overfull a line of text is for a simplified line wrapper.

Task

You're given a space-separated string or list of words. Output the minimal badness achievable for the first line.

The text needs to be wrapped on a line that's 10 characters wide, but it can only be split on spaces, no in the middle of words. Any letter that spills beyond the width counts for 1000 overfull badness each, and each leftover empty position at the end of the line counts for 1000 underfull badness.

Example

For input "Overfull hbox", we can keep the word "hbox" in the first line for 3000 overfull badness, or wrap it to the second line for 2000 underfull badness which is smaller, so the output is 2000.

0123456789 Overfull hbox ^^^ Overfull hbox ^^ 

Note that we don't care about badness of the second line.

Details

The input is a space-separated string or a list of words made of letters a-zA-Z. It won't have any words more than 10 letters long, or be more than 20 characters in total. It won't be empty or have any zero-length words.

Test cases

TODO


Sandbox: Is it OK to have a multiplier of 1000 for theme? Should the underfull and overfull badness penalties be different, like 1000 vs 2000?

added 27 characters in body
Source Link
xnor
  • 149.7k
  • 3
  • 94
  • 133

Underfull \hbox (badness 10000)

Every TeX user has been warned many times that their has been warned many timeshboxes are terribly underfull or overfull of their terribly underfull or overfull hbox's. So much badness! This challenge is to rate how badly underfull or overfull a line of text is withfor a simplified line wrapper.

Task

You areYou're given a space-separated string or list of words consistmade of letters a-zA-zZ. Output the minimal badness that can be achievedachievable for the first line.

You need to wrapThe text needs to be wrapped on a line that's 10 characters wide. The text, but it can only be split on spaces, no in the middle of words. Any letter that spillspills beyond the width countcounts for 1000 overfull badness each, and anyeach leftover empty spaceposition at the end of the line counts for 1000 underfull badness. Output the smallest badness number possible.

Examples

For input Overfull hbox, we putcan keep the word "hbox" in the first line for 3000 overfull badness, or wrap it to the second line for 2000 underfull badness which is smaller, so the output is 2000.

0123456789 Overfull hbox ^^^ Overfull hbox ^^ 

Note that we don't care about badness of the second line.

For input Supercalifragilisticexpialidocious, we can't do anything put in on one line, for badness 24000 (overfull).

Test cases

TODO


Sandbox: Is it OK to have a multiplier of 1000 for theme? Should the underfull and overfull badness penalties be different, like 1000 vs 2000?

Underfull \hbox (badness 10000)

Every TeX user has been warned many times of their terribly underfull or overfull hbox's. This challenge is to rate how badly underfull or overfull a line of text is with a simplified line wrapper.

Task

You are given space-separated string or list of words consist of letters a-zA-z. Output the minimal badness that can be achieved for the first line.

You need to wrap text on a line that's 10 characters wide. The text can only be split on spaces, no in the middle of words. Any letter that spill beyond the width count for 1000 overfull badness each, and any leftover empty space at the end of the line counts for 1000 underfull badness. Output the smallest badness number possible.

Examples

For input Overfull hbox, we put the word "hbox" in the first line for 3000 overfull badness, or wrap it to the second line for 2000 underfull badness which is smaller, so the output is 2000.

0123456789 Overfull hbox ^^^ Overfull hbox ^^ 

Note that we don't care about badness of the second line.

For input Supercalifragilisticexpialidocious, we can't do anything put in on one line, for badness 24000 (overfull).

Test cases

TODO


Sandbox: Is it OK to have a multiplier of 1000 for theme? Should the underfull and overfull badness penalties be different, like 1000 vs 2000?

Underfull \hbox (badness 10000)

Every TeX user has been warned many times that their hboxes are terribly underfull or overfull. So much badness! This challenge is to rate how badly underfull or overfull a line of text is for a simplified line wrapper.

Task

You're given a space-separated string or list of words made of letters a-zA-Z. Output the minimal badness achievable for the first line.

The text needs to be wrapped on a line that's 10 characters wide, but it can only be split on spaces, no in the middle of words. Any letter that spills beyond the width counts for 1000 overfull badness each, and each leftover empty position at the end of the line counts for 1000 underfull badness.

Examples

For input Overfull hbox, we can keep the word "hbox" in the first line for 3000 overfull badness, or wrap it to the second line for 2000 underfull badness which is smaller, so the output is 2000.

0123456789 Overfull hbox ^^^ Overfull hbox ^^ 

Note that we don't care about badness of the second line.

For input Supercalifragilisticexpialidocious, we can't do anything put in on one line for badness 24000.

Test cases

TODO


Sandbox: Is it OK to have a multiplier of 1000 for theme? Should the underfull and overfull badness penalties be different, like 1000 vs 2000?

Source Link
xnor
  • 149.7k
  • 3
  • 94
  • 133

Underfull \hbox (badness 10000)

Every TeX user has been warned many times of their terribly underfull or overfull hbox's. This challenge is to rate how badly underfull or overfull a line of text is with a simplified line wrapper.

Task

You are given space-separated string or list of words consist of letters a-zA-z. Output the minimal badness that can be achieved for the first line.

You need to wrap text on a line that's 10 characters wide. The text can only be split on spaces, no in the middle of words. Any letter that spill beyond the width count for 1000 overfull badness each, and any leftover empty space at the end of the line counts for 1000 underfull badness. Output the smallest badness number possible.

Examples

For input Overfull hbox, we put the word "hbox" in the first line for 3000 overfull badness, or wrap it to the second line for 2000 underfull badness which is smaller, so the output is 2000.

0123456789 Overfull hbox ^^^ Overfull hbox ^^ 

Note that we don't care about badness of the second line.

For input Supercalifragilisticexpialidocious, we can't do anything put in on one line, for badness 24000 (overfull).

Test cases

TODO


Sandbox: Is it OK to have a multiplier of 1000 for theme? Should the underfull and overfull badness penalties be different, like 1000 vs 2000?