Skip to main content
Notice removed Draw attention by globby
Bounty Ended with nutki's answer chosen by globby
added 34 characters in body
Source Link
globby
  • 1.2k
  • 8
  • 25

##Preface## As I was shooting an archery 900 round earlier today (3010 ends at 6 arrows an end, and 10 ends at 3 arrows an end, for a total of 90 arrows and a maximum score of 900), I thought of this challenge.

In archery (assuming that you are shooting on a FITA supplied target face [the piece of paper that you shoot at]), for each arrow you can claim a maximum score of 10. The target face contains 10 or 11 rings of decreasing diameter, nested inside one another. From the inner ring outward, these are counted from 10 points, to one point (and in the case of 11 rings, there is a secondary innermost ring that counts as 'X', which scores as 10 but is used in tie breaking cases as the higher value). Observe:

FITA Target Scoring

Of course, I am referring to the FITA Metric scoring, as seen in the above illustration. If you look closely, you may observe the innermost ring, which is a faded dotted line, whose score is not marked. That is the 'X' that I was referring to, but you will not have to pay heed to that unless competing for the bonus.

##Challenge## Create a function (or full program, if the language doesn't support functions), that receives a perfectly square image as input (or image filename, if need be), containing some number of green (HEX #00FF00, RGB(0, 255, 0)) dots of some size, and returns the score. The image may contain data other than the green dots, but the green will always be the exact same shade.

You may imagine that the square image represents the target face, with the outermost ring touching at 4 points (top center, bottom center, right center, left center). The represented target face will always be of the same proportion, with all of the rings having a width of exactly 1/20th of the input target image's width. As an example, given an input image of input dimensions 400px by 400px, you may assume that each ring has an inner width of 20px, as illustrated below:

Crappy example illustration

##Clarifications##

  • If touching two seperate rings, the higher of the two rings is counted
  • You do not have to automatically account for misses or the 'x' case, unless trying for the bonus
  • You may assume that no green circles are overlapping
  • You may also assume that no other pixels of that shade of green are in the image
  • The image will either be in a PNG, JPEG or PPM format (your choice)
  • External image processing libraries are allowed, if authored before the posting of this question
  • You may assume that all green circles on one target will have the same diameter
  • If shooting (hah) for the overlapping circles bonus, you may assume that at least one circle in the image does not have another overlapping
  • Standard loopholes are disallowed

##Test cases## The following two cases should each score 52 (or in the case of bonuses, 52 with 1 'x' and 1 miss):

And this last test case should score 25:

##Bonus##

  • -25 bytes if you also return the number of misses (outside any of the rings) as well
  • -30 bytes if you also return the amount of Xs (assume that the innermost x is 3/100ths of the width of the image, and 10 is then 2/100ths of the width of the image. The 1-9 proportions remain unchanged)
  • -35% byte count if you account for overlapping circles

This is code golf, so the least bytes wins. Have fun!

##Preface## As I was shooting an archery 900 round earlier today (30 ends at 3 arrows an end, for a total of 90 arrows and a maximum score of 900), I thought of this challenge.

In archery (assuming that you are shooting on a FITA supplied target face [the piece of paper that you shoot at]), for each arrow you can claim a maximum score of 10. The target face contains 10 or 11 rings of decreasing diameter, nested inside one another. From the inner ring outward, these are counted from 10 points, to one point (and in the case of 11 rings, there is a secondary innermost ring that counts as 'X', which scores as 10 but is used in tie breaking cases as the higher value). Observe:

FITA Target Scoring

Of course, I am referring to the FITA Metric scoring, as seen in the above illustration. If you look closely, you may observe the innermost ring, which is a faded dotted line, whose score is not marked. That is the 'X' that I was referring to, but you will not have to pay heed to that unless competing for the bonus.

##Challenge## Create a function (or full program, if the language doesn't support functions), that receives a perfectly square image as input (or image filename, if need be), containing some number of green (HEX #00FF00, RGB(0, 255, 0)) dots of some size, and returns the score. The image may contain data other than the green dots, but the green will always be the exact same shade.

You may imagine that the square image represents the target face, with the outermost ring touching at 4 points (top center, bottom center, right center, left center). The represented target face will always be of the same proportion, with all of the rings having a width of exactly 1/20th of the input target image's width. As an example, given an input image of input dimensions 400px by 400px, you may assume that each ring has an inner width of 20px, as illustrated below:

Crappy example illustration

##Clarifications##

  • If touching two seperate rings, the higher of the two rings is counted
  • You do not have to automatically account for misses or the 'x' case, unless trying for the bonus
  • You may assume that no green circles are overlapping
  • You may also assume that no other pixels of that shade of green are in the image
  • The image will either be in a PNG, JPEG or PPM format (your choice)
  • External image processing libraries are allowed, if authored before the posting of this question
  • You may assume that all green circles on one target will have the same diameter
  • If shooting (hah) for the overlapping circles bonus, you may assume that at least one circle in the image does not have another overlapping
  • Standard loopholes are disallowed

##Test cases## The following two cases should each score 52 (or in the case of bonuses, 52 with 1 'x' and 1 miss):

And this last test case should score 25:

##Bonus##

  • -25 bytes if you also return the number of misses (outside any of the rings) as well
  • -30 bytes if you also return the amount of Xs (assume that the innermost x is 3/100ths of the width of the image, and 10 is then 2/100ths of the width of the image. The 1-9 proportions remain unchanged)
  • -35% byte count if you account for overlapping circles

This is code golf, so the least bytes wins. Have fun!

##Preface## As I was shooting an archery 900 round earlier today (10 ends at 6 arrows an end, and 10 ends at 3 arrows an end, for a total of 90 arrows and a maximum score of 900), I thought of this challenge.

In archery (assuming that you are shooting on a FITA supplied target face [the piece of paper that you shoot at]), for each arrow you can claim a maximum score of 10. The target face contains 10 or 11 rings of decreasing diameter, nested inside one another. From the inner ring outward, these are counted from 10 points, to one point (and in the case of 11 rings, there is a secondary innermost ring that counts as 'X', which scores as 10 but is used in tie breaking cases as the higher value). Observe:

FITA Target Scoring

Of course, I am referring to the FITA Metric scoring, as seen in the above illustration. If you look closely, you may observe the innermost ring, which is a faded dotted line, whose score is not marked. That is the 'X' that I was referring to, but you will not have to pay heed to that unless competing for the bonus.

##Challenge## Create a function (or full program, if the language doesn't support functions), that receives a perfectly square image as input (or image filename, if need be), containing some number of green (HEX #00FF00, RGB(0, 255, 0)) dots of some size, and returns the score. The image may contain data other than the green dots, but the green will always be the exact same shade.

You may imagine that the square image represents the target face, with the outermost ring touching at 4 points (top center, bottom center, right center, left center). The represented target face will always be of the same proportion, with all of the rings having a width of exactly 1/20th of the input target image's width. As an example, given an input image of input dimensions 400px by 400px, you may assume that each ring has an inner width of 20px, as illustrated below:

Crappy example illustration

##Clarifications##

  • If touching two seperate rings, the higher of the two rings is counted
  • You do not have to automatically account for misses or the 'x' case, unless trying for the bonus
  • You may assume that no green circles are overlapping
  • You may also assume that no other pixels of that shade of green are in the image
  • The image will either be in a PNG, JPEG or PPM format (your choice)
  • External image processing libraries are allowed, if authored before the posting of this question
  • You may assume that all green circles on one target will have the same diameter
  • If shooting (hah) for the overlapping circles bonus, you may assume that at least one circle in the image does not have another overlapping
  • Standard loopholes are disallowed

##Test cases## The following two cases should each score 52 (or in the case of bonuses, 52 with 1 'x' and 1 miss):

And this last test case should score 25:

##Bonus##

  • -25 bytes if you also return the number of misses (outside any of the rings) as well
  • -30 bytes if you also return the amount of Xs (assume that the innermost x is 3/100ths of the width of the image, and 10 is then 2/100ths of the width of the image. The 1-9 proportions remain unchanged)
  • -35% byte count if you account for overlapping circles

This is code golf, so the least bytes wins. Have fun!

added 226 characters in body
Source Link
globby
  • 1.2k
  • 8
  • 25

##Preface## As I was shooting an archery 900 round earlier today (30 ends at 3 arrows an end, for a total of 90 arrows and a maximum score of 900), I thought of this challenge.

In archery (assuming that you are shooting on a FITA supplied target face [the piece of paper that you shoot at]), for each arrow you can claim a maximum score of 10. The target face contains 10 or 11 rings of decreasing diameter, nested inside one another. From the inner ring outward, these are counted from 10 points, to one point (and in the case of 11 rings, there is a secondary innermost ring that counts as 'X', which scores as 10 but is used in tie breaking cases as the higher value). Observe:

FITA Target Scoring

Of course, I am referring to the FITA Metric scoring, as seen in the above illustration. If you look closely, you may observe the innermost ring, which is a faded dotted line, whose score is not marked. That is the 'X' that I was referring to, but you will not have to pay heed to that unless competing for the bonus.

##Challenge## Create a function (or full program, if the language doesn't support functions), that receives a perfectly square image as input (or image filename, if need be), containing some number of green (HEX #00FF00, RGB(0, 255, 0)) dots of some size, and returns the score. The image may contain data other than the green dots, but the green will always be the exact same shade.

You may imagine that the square image represents the target face, with the outermost ring touching at 4 points (top center, bottom center, right center, left center). The represented target face will always be of the same proportion, with all of the rings having a width of exactly 1/20th of the input target image's width. As an example, given an input image of input dimensions 400px by 400px, you may assume that each ring has an inner width of 20px, as illustrated below:

Crappy example illustration

##Clarifications##

  • If touching two seperate rings, the higher of the two rings is counted
  • You do not have to automatically account for misses or the 'x' case, unless trying for the bonus
  • You may assume that no green circles are overlapping
  • You may also assume that no other pixels of that shade of green are in the image
  • The image will either be in a PNG, JPEG or PPM format (your choice)
  • External image processing libraries are allowed, if authored before the posting of this question
  • You may assume that all green circles on one target will have the same diameter
  • If shooting (hah) for the overlapping circles bonus, you may assume that at least one circle in the image does not have another overlapping
  • Standard loopholes are disallowed

##Test cases## The following two cases should each score 52 (or in the case of bonuses, 52 with 1 'x' and 1 miss):

And this last test case should score 25:

##Bonus##

  • -25 bytes if you also return the number of misses (outside any of the rings) as well
  • -30 bytes if you also return the amount of Xs (assume that the innermost x is 3/100ths of the width of the image, and 10 is then 2/100ths of the width of the image. The 1-9 proportions remain unchanged)
  • -35% byte count if you account for overlapping circles

This is code golf, so the least bytes wins. Have fun!

##Preface## As I was shooting an archery 900 round earlier today (30 ends at 3 arrows an end, for a total of 90 arrows and a maximum score of 900), I thought of this challenge.

In archery (assuming that you are shooting on a FITA supplied target face [the piece of paper that you shoot at]), for each arrow you can claim a maximum score of 10. The target face contains 10 or 11 rings of decreasing diameter, nested inside one another. From the inner ring outward, these are counted from 10 points, to one point (and in the case of 11 rings, there is a secondary innermost ring that counts as 'X', which scores as 10 but is used in tie breaking cases as the higher value). Observe:

FITA Target Scoring

Of course, I am referring to the FITA Metric scoring, as seen in the above illustration. If you look closely, you may observe the innermost ring, which is a faded dotted line, whose score is not marked. That is the 'X' that I was referring to, but you will not have to pay heed to that unless competing for the bonus.

##Challenge## Create a function (or full program, if the language doesn't support functions), that receives a perfectly square image as input (or image filename, if need be), containing some number of green (HEX #00FF00, RGB(0, 255, 0)) dots of some size, and returns the score. The image may contain data other than the green dots, but the green will always be the exact same shade.

You may imagine that the square image represents the target face, with the outermost ring touching at 4 points (top center, bottom center, right center, left center). The represented target face will always be of the same proportion, with all of the rings having a width of exactly 1/20th of the input target image's width. As an example, given an input image of input dimensions 400px by 400px, you may assume that each ring has an inner width of 20px, as illustrated below:

Crappy example illustration

##Clarifications##

  • If touching two seperate rings, the higher of the two rings is counted
  • You do not have to automatically account for misses or the 'x' case, unless trying for the bonus
  • You may assume that no green circles are overlapping
  • You may also assume that no other pixels of that shade of green are in the image
  • The image will either be in a PNG, JPEG or PPM format (your choice)
  • External image processing libraries are allowed, if authored before the posting of this question
  • Standard loopholes are disallowed

##Test cases## The following two cases should each score 52 (or in the case of bonuses, 52 with 1 'x' and 1 miss):

And this last test case should score 25:

##Bonus##

  • -25 bytes if you also return the number of misses (outside any of the rings) as well
  • -30 bytes if you also return the amount of Xs (assume that the innermost x is 3/100ths of the width of the image, and 10 is then 2/100ths of the width of the image. The 1-9 proportions remain unchanged)
  • -35% byte count if you account for overlapping circles

This is code golf, so the least bytes wins. Have fun!

##Preface## As I was shooting an archery 900 round earlier today (30 ends at 3 arrows an end, for a total of 90 arrows and a maximum score of 900), I thought of this challenge.

In archery (assuming that you are shooting on a FITA supplied target face [the piece of paper that you shoot at]), for each arrow you can claim a maximum score of 10. The target face contains 10 or 11 rings of decreasing diameter, nested inside one another. From the inner ring outward, these are counted from 10 points, to one point (and in the case of 11 rings, there is a secondary innermost ring that counts as 'X', which scores as 10 but is used in tie breaking cases as the higher value). Observe:

FITA Target Scoring

Of course, I am referring to the FITA Metric scoring, as seen in the above illustration. If you look closely, you may observe the innermost ring, which is a faded dotted line, whose score is not marked. That is the 'X' that I was referring to, but you will not have to pay heed to that unless competing for the bonus.

##Challenge## Create a function (or full program, if the language doesn't support functions), that receives a perfectly square image as input (or image filename, if need be), containing some number of green (HEX #00FF00, RGB(0, 255, 0)) dots of some size, and returns the score. The image may contain data other than the green dots, but the green will always be the exact same shade.

You may imagine that the square image represents the target face, with the outermost ring touching at 4 points (top center, bottom center, right center, left center). The represented target face will always be of the same proportion, with all of the rings having a width of exactly 1/20th of the input target image's width. As an example, given an input image of input dimensions 400px by 400px, you may assume that each ring has an inner width of 20px, as illustrated below:

Crappy example illustration

##Clarifications##

  • If touching two seperate rings, the higher of the two rings is counted
  • You do not have to automatically account for misses or the 'x' case, unless trying for the bonus
  • You may assume that no green circles are overlapping
  • You may also assume that no other pixels of that shade of green are in the image
  • The image will either be in a PNG, JPEG or PPM format (your choice)
  • External image processing libraries are allowed, if authored before the posting of this question
  • You may assume that all green circles on one target will have the same diameter
  • If shooting (hah) for the overlapping circles bonus, you may assume that at least one circle in the image does not have another overlapping
  • Standard loopholes are disallowed

##Test cases## The following two cases should each score 52 (or in the case of bonuses, 52 with 1 'x' and 1 miss):

And this last test case should score 25:

##Bonus##

  • -25 bytes if you also return the number of misses (outside any of the rings) as well
  • -30 bytes if you also return the amount of Xs (assume that the innermost x is 3/100ths of the width of the image, and 10 is then 2/100ths of the width of the image. The 1-9 proportions remain unchanged)
  • -35% byte count if you account for overlapping circles

This is code golf, so the least bytes wins. Have fun!

Notice added Draw attention by globby
Bounty Started worth 100 reputation by globby
added 86 characters in body
Source Link
globby
  • 1.2k
  • 8
  • 25

##Preface## As I was shooting an archery 900 round earlier today (30 ends at 3 arrows an end, for a total of 90 arrows and a maximum score of 900), I thought of this challenge.

In archery (assuming that you are shooting on a FITA supplied target face [the piece of paper that you shoot at]), for each arrow you can claim a maximum score of 10. The target face contains 10 or 11 rings of decreasing diameter, nested inside one another. From the inner ring outward, these are counted from 10 points, to one point (and in the case of 11 rings, there is a secondary innermost ring that counts as 'X', which scores as 10 but is used in tie breaking cases as the higher value). Observe:

FITA Target Scoring

Of course, I am referring to the FITA Metric scoring, as seen in the above illustration. If you look closely, you may observe the innermost ring, which is a faded dotted line, whose score is not marked. That is the 'X' that I was referring to, but you will not have to pay heed to that unless competing for the bonus.

##Challenge## Create a function (or full program, if the language doesn't suppersupport functions), that receives a perfectly square image as input (or image filename, if need be), containing some number of green (HEX #00FF00, RGB(0, 255, 0)) dots of some size, and returns the score. The image may contain data other than the green dots, but the green will always be the exact same shade.

You may imagine that the square image represents the target face, with the outermost ring touching at 4 points (top center, bottom center, right center, left center). The represented target face will always be of the same proportion, with all of the rings having a width of exactly 1/20th of the input target image's width. As an example, given an input image of input dimensions 400px by 400px, you may assume that each ring has an inner width of 20px, as illustrated below:

Crappy example illustration

##Clarifications##

  • If touching two seperate rings, the higher of the two rings is counted
  • You do not have to automatically account for misses or the 'x' case, unless trying for the bonus
  • You may assume that no green circles are overlapping
  • You may also assume that no other pixels of that shade of green are in the image
  • The image will either be in a PNG, JPEG or PPM format (your choice)
  • External image processing libraries are allowed, if authored before the posting of this question
  • Standard loopholes are disallowed

##Test cases## The following two cases should each score 52 (or in the case of bonuses, 52 with 1 'x' and 1 miss):

And this last test case should score 25:

##Bonus##

  • -25 bytes if you also return the number of misses (outside any of the rings) as well
  • -30 bytes if you also return the amount of Xs (assume that the innermost x is 3/100ths of the width of the image, and 10 is then 2/100ths of the width of the image. The 1-9 proportions remain unchanged)
  • -35% byte count if you account for overlapping circles

This is code golf, so the least bytes wins. Have fun!

##Preface## As I was shooting an archery 900 round earlier today (30 ends at 3 arrows an end, for a total of 90 arrows and a maximum score of 900), I thought of this challenge.

In archery (assuming that you are shooting on a FITA supplied target face [the piece of paper that you shoot at]), for each arrow you can claim a maximum score of 10. The target face contains 10 or 11 rings of decreasing diameter, nested inside one another. From the inner ring outward, these are counted from 10 points, to one point (and in the case of 11 rings, there is a secondary innermost ring that counts as 'X', which scores as 10 but is used in tie breaking cases as the higher value). Observe:

FITA Target Scoring

Of course, I am referring to the FITA Metric scoring, as seen in the above illustration. If you look closely, you may observe the innermost ring, which is a faded dotted line, whose score is not marked. That is the 'X' that I was referring to, but you will not have to pay heed to that unless competing for the bonus.

##Challenge## Create a function (or full program, if the language doesn't supper functions), that receives a perfectly square image as input (or image filename, if need be), containing some number of green (HEX #00FF00, RGB(0, 255, 0)) dots of some size, and returns the score. The image may contain data other than the green dots, but the green will always be the exact same shade.

You may imagine that the square image represents the target face, with the outermost ring touching at 4 points (top center, bottom center, right center, left center). The represented target face will always be of the same proportion, with all of the rings having a width of exactly 1/20th of the input target image's width. As an example, given an input image of input dimensions 400px by 400px, you may assume that each ring has an inner width of 20px, as illustrated below:

Crappy example illustration

##Clarifications##

  • If touching two seperate rings, the higher of the two rings is counted
  • You do not have to automatically account for misses or the 'x' case, unless trying for the bonus
  • You may assume that no green circles are overlapping
  • The image will either be in a PNG, JPEG or PPM format (your choice)
  • External image processing libraries are allowed, if authored before the posting of this question
  • Standard loopholes are disallowed

##Test cases## The following two cases should each score 52 (or in the case of bonuses, 52 with 1 'x' and 1 miss):

And this last test case should score 25:

##Bonus##

  • -25 bytes if you also return the number of misses (outside any of the rings) as well
  • -30 bytes if you also return the amount of Xs (assume that the innermost x is 3/100ths of the width of the image, and 10 is then 2/100ths of the width of the image. The 1-9 proportions remain unchanged)
  • -35% byte count if you account for overlapping circles

This is code golf, so the least bytes wins. Have fun!

##Preface## As I was shooting an archery 900 round earlier today (30 ends at 3 arrows an end, for a total of 90 arrows and a maximum score of 900), I thought of this challenge.

In archery (assuming that you are shooting on a FITA supplied target face [the piece of paper that you shoot at]), for each arrow you can claim a maximum score of 10. The target face contains 10 or 11 rings of decreasing diameter, nested inside one another. From the inner ring outward, these are counted from 10 points, to one point (and in the case of 11 rings, there is a secondary innermost ring that counts as 'X', which scores as 10 but is used in tie breaking cases as the higher value). Observe:

FITA Target Scoring

Of course, I am referring to the FITA Metric scoring, as seen in the above illustration. If you look closely, you may observe the innermost ring, which is a faded dotted line, whose score is not marked. That is the 'X' that I was referring to, but you will not have to pay heed to that unless competing for the bonus.

##Challenge## Create a function (or full program, if the language doesn't support functions), that receives a perfectly square image as input (or image filename, if need be), containing some number of green (HEX #00FF00, RGB(0, 255, 0)) dots of some size, and returns the score. The image may contain data other than the green dots, but the green will always be the exact same shade.

You may imagine that the square image represents the target face, with the outermost ring touching at 4 points (top center, bottom center, right center, left center). The represented target face will always be of the same proportion, with all of the rings having a width of exactly 1/20th of the input target image's width. As an example, given an input image of input dimensions 400px by 400px, you may assume that each ring has an inner width of 20px, as illustrated below:

Crappy example illustration

##Clarifications##

  • If touching two seperate rings, the higher of the two rings is counted
  • You do not have to automatically account for misses or the 'x' case, unless trying for the bonus
  • You may assume that no green circles are overlapping
  • You may also assume that no other pixels of that shade of green are in the image
  • The image will either be in a PNG, JPEG or PPM format (your choice)
  • External image processing libraries are allowed, if authored before the posting of this question
  • Standard loopholes are disallowed

##Test cases## The following two cases should each score 52 (or in the case of bonuses, 52 with 1 'x' and 1 miss):

And this last test case should score 25:

##Bonus##

  • -25 bytes if you also return the number of misses (outside any of the rings) as well
  • -30 bytes if you also return the amount of Xs (assume that the innermost x is 3/100ths of the width of the image, and 10 is then 2/100ths of the width of the image. The 1-9 proportions remain unchanged)
  • -35% byte count if you account for overlapping circles

This is code golf, so the least bytes wins. Have fun!

Tweeted twitter.com/#!/StackCodeGolf/status/549602958816862209
added 11 characters in body; added 38 characters in body
Source Link
globby
  • 1.2k
  • 8
  • 25
Loading
edited body
Source Link
globby
  • 1.2k
  • 8
  • 25
Loading
edited body
Source Link
Peter Taylor
  • 43.1k
  • 4
  • 70
  • 169
Loading
added 57 characters in body
Source Link
globby
  • 1.2k
  • 8
  • 25
Loading
added 143 characters in body; edited body; edited body
Source Link
globby
  • 1.2k
  • 8
  • 25
Loading
added 66 characters in body
Source Link
globby
  • 1.2k
  • 8
  • 25
Loading
edited tags
Link
Doorknob
  • 71.7k
  • 20
  • 143
  • 385
Loading
deleted 68 characters in body
Source Link
globby
  • 1.2k
  • 8
  • 25
Loading
Source Link
globby
  • 1.2k
  • 8
  • 25
Loading