Impossible darts scoresFrequency Distribution of Mixed Dice RollsDarts meets CodegolfParse a Python string...
Why do all the teams that I have worked with always finish a sprint without completion of all the stories?
Can White Castle?
Employer wants to use my work email account after I quit
Do I have to explain the mechanical superiority of the player-character within the fiction of the game?
How to draw this center trajectory of rolling ball?
Parameterize chained calls to a utility program in Bash
How is hair tissue mineral analysis performed?
Cut the gold chain
Why tighten down in a criss-cross pattern?
How can I politely work my way around not liking coffee or beer when it comes to professional networking?
Loss of power when I remove item from the outlet
How to model a twisted cylinder like this
What does it mean to "control target player"?
Dates on degrees don’t make sense – will people care?
What was the Shuttle Carrier Aircraft escape tunnel?
How does a pilot select the correct ILS when the airport has parallel runways?
Should developer taking test phones home or put in office?
What is "industrial ethernet"?
Are all instances of trolls turning to stone ultimately references back to Tolkien?
Inaccessible base class despite friendship
How do I turn off a repeating trade?
Is it illegal to withhold someone's passport and green card in California?
Did the CIA blow up a Siberian pipeline in 1982?
Would it be a copyright violation if I made a character’s full name refer to a song?
Impossible darts scores
Frequency Distribution of Mixed Dice RollsDarts meets CodegolfParse a Python string literalDarts meets CodegolfConfused badminton playersAverages of AnglesHalloween Golf: The 2spooky4me Challenge!The mad chemist and the clever programmerBASKETBALL FRVR?Primitive Pythagorean TriplesPlaying Darts: become an amateur with the most efficient prioritizingScore a single dart
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
$begingroup$
I was surprised to not find this asked already, though there is a great question on darts checkouts: Darts meets Codegolf
Your challenge is to calculate which scores are not possible with 'n' darts below the maximum score for 'n' darts. E.g. for n=3, the maximum possible score is 180 so you would return [163,166,169,172,173,175,176,178,179]
For a bare bones rule summary:
Possible scores for a single dart are:
- 0 (miss)
- 1-20, 25, 50
- double or triple of 1-20
Rules:
- standard code golf rules apply
- you must take a single parameter 'n' in whatever way your language allows and return a list/array of all unique scores below the maximum score which cannot be scored with n darts. You may also print these values to the console.
- order of results is unimportant
- shortest code in bytes wins
code-golf
$endgroup$
add a comment |
$begingroup$
I was surprised to not find this asked already, though there is a great question on darts checkouts: Darts meets Codegolf
Your challenge is to calculate which scores are not possible with 'n' darts below the maximum score for 'n' darts. E.g. for n=3, the maximum possible score is 180 so you would return [163,166,169,172,173,175,176,178,179]
For a bare bones rule summary:
Possible scores for a single dart are:
- 0 (miss)
- 1-20, 25, 50
- double or triple of 1-20
Rules:
- standard code golf rules apply
- you must take a single parameter 'n' in whatever way your language allows and return a list/array of all unique scores below the maximum score which cannot be scored with n darts. You may also print these values to the console.
- order of results is unimportant
- shortest code in bytes wins
code-golf
$endgroup$
$begingroup$
Apologies for formatting, writing on a phone!
$endgroup$
– beirtipol
8 hours ago
$begingroup$
somewhat related; I think there was another one about finding missing values from a range but I can't seem to find it.
$endgroup$
– Giuseppe
8 hours ago
$begingroup$
Sincere apologies, I pulled those outputs from an answer to the basic question of 3 darts but did not verify! I will update the question!
$endgroup$
– beirtipol
8 hours ago
1
$begingroup$
no worries :-) Looks fine to me!
$endgroup$
– Giuseppe
8 hours ago
add a comment |
$begingroup$
I was surprised to not find this asked already, though there is a great question on darts checkouts: Darts meets Codegolf
Your challenge is to calculate which scores are not possible with 'n' darts below the maximum score for 'n' darts. E.g. for n=3, the maximum possible score is 180 so you would return [163,166,169,172,173,175,176,178,179]
For a bare bones rule summary:
Possible scores for a single dart are:
- 0 (miss)
- 1-20, 25, 50
- double or triple of 1-20
Rules:
- standard code golf rules apply
- you must take a single parameter 'n' in whatever way your language allows and return a list/array of all unique scores below the maximum score which cannot be scored with n darts. You may also print these values to the console.
- order of results is unimportant
- shortest code in bytes wins
code-golf
$endgroup$
I was surprised to not find this asked already, though there is a great question on darts checkouts: Darts meets Codegolf
Your challenge is to calculate which scores are not possible with 'n' darts below the maximum score for 'n' darts. E.g. for n=3, the maximum possible score is 180 so you would return [163,166,169,172,173,175,176,178,179]
For a bare bones rule summary:
Possible scores for a single dart are:
- 0 (miss)
- 1-20, 25, 50
- double or triple of 1-20
Rules:
- standard code golf rules apply
- you must take a single parameter 'n' in whatever way your language allows and return a list/array of all unique scores below the maximum score which cannot be scored with n darts. You may also print these values to the console.
- order of results is unimportant
- shortest code in bytes wins
code-golf
code-golf
edited 8 hours ago
beirtipol
asked 8 hours ago
beirtipolbeirtipol
25118
25118
$begingroup$
Apologies for formatting, writing on a phone!
$endgroup$
– beirtipol
8 hours ago
$begingroup$
somewhat related; I think there was another one about finding missing values from a range but I can't seem to find it.
$endgroup$
– Giuseppe
8 hours ago
$begingroup$
Sincere apologies, I pulled those outputs from an answer to the basic question of 3 darts but did not verify! I will update the question!
$endgroup$
– beirtipol
8 hours ago
1
$begingroup$
no worries :-) Looks fine to me!
$endgroup$
– Giuseppe
8 hours ago
add a comment |
$begingroup$
Apologies for formatting, writing on a phone!
$endgroup$
– beirtipol
8 hours ago
$begingroup$
somewhat related; I think there was another one about finding missing values from a range but I can't seem to find it.
$endgroup$
– Giuseppe
8 hours ago
$begingroup$
Sincere apologies, I pulled those outputs from an answer to the basic question of 3 darts but did not verify! I will update the question!
$endgroup$
– beirtipol
8 hours ago
1
$begingroup$
no worries :-) Looks fine to me!
$endgroup$
– Giuseppe
8 hours ago
$begingroup$
Apologies for formatting, writing on a phone!
$endgroup$
– beirtipol
8 hours ago
$begingroup$
Apologies for formatting, writing on a phone!
$endgroup$
– beirtipol
8 hours ago
$begingroup$
somewhat related; I think there was another one about finding missing values from a range but I can't seem to find it.
$endgroup$
– Giuseppe
8 hours ago
$begingroup$
somewhat related; I think there was another one about finding missing values from a range but I can't seem to find it.
$endgroup$
– Giuseppe
8 hours ago
$begingroup$
Sincere apologies, I pulled those outputs from an answer to the basic question of 3 darts but did not verify! I will update the question!
$endgroup$
– beirtipol
8 hours ago
$begingroup$
Sincere apologies, I pulled those outputs from an answer to the basic question of 3 darts but did not verify! I will update the question!
$endgroup$
– beirtipol
8 hours ago
1
1
$begingroup$
no worries :-) Looks fine to me!
$endgroup$
– Giuseppe
8 hours ago
$begingroup$
no worries :-) Looks fine to me!
$endgroup$
– Giuseppe
8 hours ago
add a comment |
14 Answers
14
active
oldest
votes
$begingroup$
Python 3, 80 79 59 bytes
-1 byte thanks to Arnauld-20 byte thanks to ArBo
lambda x:[60*x-i+80for i in b'uomigc`]a^[XWUTRQ'[(x>1)*8:]]
Try it online!
$endgroup$
1
$begingroup$
I, errr, what?!
$endgroup$
– beirtipol
7 hours ago
$begingroup$
@beirtipol there is a pattern on the numbers after the 2nd dart (well, its on the 1st dart too, but there are another numbers), this calculate the numbers based on this pattern.
$endgroup$
– Rod
7 hours ago
1
$begingroup$
Ah, well played, well played indeed
$endgroup$
– beirtipol
7 hours ago
$begingroup$
You can compress the second list for -6 bytes.
$endgroup$
– Erik the Outgolfer
6 hours ago
1
$begingroup$
@EriktheOutgolfer If you're compressing, you might as well compress everything ;) 59 bytes
$endgroup$
– ArBo
5 hours ago
|
show 1 more comment
$begingroup$
R, 64 bytes
function(n,`!`=utf8ToInt)c(60*n-!"",(!"#%),/")[n<2])
Try it online!
Ports the amazing answer found by Rod.
R, 85 73 68 bytes
function(n)setdiff(0:(60*n),combn(rep(c(0:20%o%1:3,25,50),n),n,sum))
Try it online!
Brute force generates all possible scores with n
darts, then takes the appropriate set difference.
Credit to OrangeCherries' Octave solution for reminding me of combn
.
5 more bytes thanks to Robin Ryder's suggestion of using %o%
.
$endgroup$
$begingroup$
Very sorry about that, I should have double checked the example!
$endgroup$
– beirtipol
8 hours ago
1
$begingroup$
Nice use of theFUN
argument ofcombn
! You can get 68 bytes with%o%
instead ofx*3,x*2
.
$endgroup$
– Robin Ryder
7 hours ago
$begingroup$
@RobinRyder duh. I even tried figuring out how to do broadcasting multiplication on the Octave answer!
$endgroup$
– Giuseppe
7 hours ago
add a comment |
$begingroup$
JavaScript (ES6), 55 bytes
Based on the pattern used by Rod.
n=>[...1121213+[n-1?33:2121242426]].map(x=>s-=x,s=60*n)
Try it online!
$endgroup$
add a comment |
$begingroup$
Jelly, 19 bytes
20Ż;25×Ɱ3ẎṖœċ⁸§ṪṖḟƊ
Try it online!
$endgroup$
add a comment |
$begingroup$
Python 2, 125 bytes
lambda n:set(range(60*n))-set(map(sum,product(sum([range(0,21*j,j)for j in 1,2,3],[25,50]),repeat=n)))
from itertools import*
Try it online!
Python 3, 126 125 bytes
lambda n:{*range(60*n)}-{*map(sum,product([i*j for i in range(21)for j in(1,2,3)]+[25,50],repeat=n))}
from itertools import*
Try it online!
$endgroup$
$begingroup$
On the py3 answer, you can useproduct(sum([[i,i*2,i*3]for i in range(21)],[25,50]),repeat=n)
to save 3 bytes
$endgroup$
– Rod
8 hours ago
add a comment |
$begingroup$
Octave, 91 bytes 73 bytes 71 Bytes
Another brute force method. Not sure about the rule on the 'f=' part for anonymous functions
@(n)setdiff(0:60*n,sum(combnk(repmat([x=0:20,x*2,x*3,25,50],1,n),n),2))
Down to 73 Bytes thanks to Giuseppe
Down to 71 Bytes by replacing nchoosek with combnk
Try it online!
$endgroup$
add a comment |
$begingroup$
MATL, 25 bytes
:!21:q*25tEvGZ^!stX>Q:qX~
Try it online!
Explanation
Brute force approach.
:! % Implicit input n. Push column vector [1;2;...;n]
21:q % Push row vector [0 1 ... 20]
* % Multiply with broadcast. Gives a matrix with all products
25 % Push 25
tE % Duplicate, double: gives 50
v % Concatenate everything into a column vector
GZ^ % Cartesian power with n. Gives a matrix with each n-tuple on a row
!s % Sum of each row
tX> % Duplicate, maximum. This gives 60*n
Q:q % Push row vector [0 1 ... 60*n]
X~ % Symmetric difference. Implicit display
$endgroup$
add a comment |
$begingroup$
Perl 6, 42 bytes
{^60*$_∖[X+] [[|(^21 X*^4),25,50]xx$_,]}
Try it online!
Brute force solution that works out all possible dart values.
$endgroup$
add a comment |
$begingroup$
Perl 6, 39 bytes (37 chars)
This is definitely using a massive sledgehammer but it works. (It doesn't just brute force it, it brutally brute forces it)
{^60*$_∖[X+] (|(^21 X*^4),25,50)xx$_}
Try it online!
Here's an explanation of it:
{ } anonymous block for the
∖ set difference of
^60*$_ - 0 .. max score (60 * throwcount)
[X+] xx$n - the cross addition (throwcount times) of
( ) all possible score values, being
|( X* ) flattened cross multiplication of
^21 ^4 0..20 and 0..3 (for double and triple)
,25,50 and 25 and 50
The X* ^4
cross multiplier generates a lot of duplicate values (there will be 20+ zeros involved and that's before doing the cross addition), but that doesn't cause any problems since we use the set difference ∖
which works with the unique values.
This currently fails for $n == 1
(which should return an empty set), but there is an issue filed and will likely work in future versions. JoKing's version is a teeny bit longer, but works for $n == 1
in current Rakudo.
$endgroup$
$begingroup$
Wow, awkward... My extra bytes are from fixing the n=1 issue (though you can use $_ instead of $^n for -1)
$endgroup$
– Jo King
4 hours ago
1
$begingroup$
@JoKing ha, I don't think there's anything wrong with two people getting virtually the same answer (especially since yours works in current versions versus mine that's currently theoretical) Also, thanks on the $_ , total brainfart on my part
$endgroup$
– guifa
4 hours ago
add a comment |
$begingroup$
Jelly, 28 bytes
21Ḷ×þ3R¤;25;50FœċµS€³×60¤R¤ḟ
Try it online!
$endgroup$
add a comment |
$begingroup$
Charcoal, 36 bytes
I⁺E…wvtsqpmjgkhea_[YS⎇⊖θ⁹¦¹⁷℅ι×⁶⁰⁻θ²
Try it online! Link is to verbose version of code. Uses @Rod's algorithm; brute force would have taken 60 bytes. Works by truncating the string to 9 characters if the input is greater than 1, then taking the ordinals of the characters and adding the appropriate multiple of 60.
$endgroup$
add a comment |
$begingroup$
J, 48 bytes
(2&>#35 44,q:@1474249423),60&*-1 4 8 14,q:@13090
Try it online!
Attempted a brute force solution, but was not able to beat this translation of Rod's idea.
$endgroup$
add a comment |
$begingroup$
Perl 5 -n
, 96 bytes
$"=',';@b=map{(25,50,$_,$_*2,$_*3)}0..20;%k=map{(eval,1)}glob"+{@b}"x$_;$k{$_}||say for 0..$_*60
Try it online!
It was optimized for code length rather than run time, so it's kind of slow. It generates a lot of redundant entries for its lookup hash. Running the @b
array through uniq
speeds it up greatly, but costs 5 more bytes, so I didn't do it.
$endgroup$
add a comment |
$begingroup$
Stax, 24 bytes
¿ß☺o↕αg╠╩╬ò▼í¬«¥↕▄í■♣▓î►
Run and debug it
It's pretty slow for n=3, and gets worse from there.
$endgroup$
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "200"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f187105%2fimpossible-darts-scores%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
14 Answers
14
active
oldest
votes
14 Answers
14
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
Python 3, 80 79 59 bytes
-1 byte thanks to Arnauld-20 byte thanks to ArBo
lambda x:[60*x-i+80for i in b'uomigc`]a^[XWUTRQ'[(x>1)*8:]]
Try it online!
$endgroup$
1
$begingroup$
I, errr, what?!
$endgroup$
– beirtipol
7 hours ago
$begingroup$
@beirtipol there is a pattern on the numbers after the 2nd dart (well, its on the 1st dart too, but there are another numbers), this calculate the numbers based on this pattern.
$endgroup$
– Rod
7 hours ago
1
$begingroup$
Ah, well played, well played indeed
$endgroup$
– beirtipol
7 hours ago
$begingroup$
You can compress the second list for -6 bytes.
$endgroup$
– Erik the Outgolfer
6 hours ago
1
$begingroup$
@EriktheOutgolfer If you're compressing, you might as well compress everything ;) 59 bytes
$endgroup$
– ArBo
5 hours ago
|
show 1 more comment
$begingroup$
Python 3, 80 79 59 bytes
-1 byte thanks to Arnauld-20 byte thanks to ArBo
lambda x:[60*x-i+80for i in b'uomigc`]a^[XWUTRQ'[(x>1)*8:]]
Try it online!
$endgroup$
1
$begingroup$
I, errr, what?!
$endgroup$
– beirtipol
7 hours ago
$begingroup$
@beirtipol there is a pattern on the numbers after the 2nd dart (well, its on the 1st dart too, but there are another numbers), this calculate the numbers based on this pattern.
$endgroup$
– Rod
7 hours ago
1
$begingroup$
Ah, well played, well played indeed
$endgroup$
– beirtipol
7 hours ago
$begingroup$
You can compress the second list for -6 bytes.
$endgroup$
– Erik the Outgolfer
6 hours ago
1
$begingroup$
@EriktheOutgolfer If you're compressing, you might as well compress everything ;) 59 bytes
$endgroup$
– ArBo
5 hours ago
|
show 1 more comment
$begingroup$
Python 3, 80 79 59 bytes
-1 byte thanks to Arnauld-20 byte thanks to ArBo
lambda x:[60*x-i+80for i in b'uomigc`]a^[XWUTRQ'[(x>1)*8:]]
Try it online!
$endgroup$
Python 3, 80 79 59 bytes
-1 byte thanks to Arnauld-20 byte thanks to ArBo
lambda x:[60*x-i+80for i in b'uomigc`]a^[XWUTRQ'[(x>1)*8:]]
Try it online!
edited 5 hours ago
answered 8 hours ago
RodRod
16.7k41983
16.7k41983
1
$begingroup$
I, errr, what?!
$endgroup$
– beirtipol
7 hours ago
$begingroup$
@beirtipol there is a pattern on the numbers after the 2nd dart (well, its on the 1st dart too, but there are another numbers), this calculate the numbers based on this pattern.
$endgroup$
– Rod
7 hours ago
1
$begingroup$
Ah, well played, well played indeed
$endgroup$
– beirtipol
7 hours ago
$begingroup$
You can compress the second list for -6 bytes.
$endgroup$
– Erik the Outgolfer
6 hours ago
1
$begingroup$
@EriktheOutgolfer If you're compressing, you might as well compress everything ;) 59 bytes
$endgroup$
– ArBo
5 hours ago
|
show 1 more comment
1
$begingroup$
I, errr, what?!
$endgroup$
– beirtipol
7 hours ago
$begingroup$
@beirtipol there is a pattern on the numbers after the 2nd dart (well, its on the 1st dart too, but there are another numbers), this calculate the numbers based on this pattern.
$endgroup$
– Rod
7 hours ago
1
$begingroup$
Ah, well played, well played indeed
$endgroup$
– beirtipol
7 hours ago
$begingroup$
You can compress the second list for -6 bytes.
$endgroup$
– Erik the Outgolfer
6 hours ago
1
$begingroup$
@EriktheOutgolfer If you're compressing, you might as well compress everything ;) 59 bytes
$endgroup$
– ArBo
5 hours ago
1
1
$begingroup$
I, errr, what?!
$endgroup$
– beirtipol
7 hours ago
$begingroup$
I, errr, what?!
$endgroup$
– beirtipol
7 hours ago
$begingroup$
@beirtipol there is a pattern on the numbers after the 2nd dart (well, its on the 1st dart too, but there are another numbers), this calculate the numbers based on this pattern.
$endgroup$
– Rod
7 hours ago
$begingroup$
@beirtipol there is a pattern on the numbers after the 2nd dart (well, its on the 1st dart too, but there are another numbers), this calculate the numbers based on this pattern.
$endgroup$
– Rod
7 hours ago
1
1
$begingroup$
Ah, well played, well played indeed
$endgroup$
– beirtipol
7 hours ago
$begingroup$
Ah, well played, well played indeed
$endgroup$
– beirtipol
7 hours ago
$begingroup$
You can compress the second list for -6 bytes.
$endgroup$
– Erik the Outgolfer
6 hours ago
$begingroup$
You can compress the second list for -6 bytes.
$endgroup$
– Erik the Outgolfer
6 hours ago
1
1
$begingroup$
@EriktheOutgolfer If you're compressing, you might as well compress everything ;) 59 bytes
$endgroup$
– ArBo
5 hours ago
$begingroup$
@EriktheOutgolfer If you're compressing, you might as well compress everything ;) 59 bytes
$endgroup$
– ArBo
5 hours ago
|
show 1 more comment
$begingroup$
R, 64 bytes
function(n,`!`=utf8ToInt)c(60*n-!"",(!"#%),/")[n<2])
Try it online!
Ports the amazing answer found by Rod.
R, 85 73 68 bytes
function(n)setdiff(0:(60*n),combn(rep(c(0:20%o%1:3,25,50),n),n,sum))
Try it online!
Brute force generates all possible scores with n
darts, then takes the appropriate set difference.
Credit to OrangeCherries' Octave solution for reminding me of combn
.
5 more bytes thanks to Robin Ryder's suggestion of using %o%
.
$endgroup$
$begingroup$
Very sorry about that, I should have double checked the example!
$endgroup$
– beirtipol
8 hours ago
1
$begingroup$
Nice use of theFUN
argument ofcombn
! You can get 68 bytes with%o%
instead ofx*3,x*2
.
$endgroup$
– Robin Ryder
7 hours ago
$begingroup$
@RobinRyder duh. I even tried figuring out how to do broadcasting multiplication on the Octave answer!
$endgroup$
– Giuseppe
7 hours ago
add a comment |
$begingroup$
R, 64 bytes
function(n,`!`=utf8ToInt)c(60*n-!"",(!"#%),/")[n<2])
Try it online!
Ports the amazing answer found by Rod.
R, 85 73 68 bytes
function(n)setdiff(0:(60*n),combn(rep(c(0:20%o%1:3,25,50),n),n,sum))
Try it online!
Brute force generates all possible scores with n
darts, then takes the appropriate set difference.
Credit to OrangeCherries' Octave solution for reminding me of combn
.
5 more bytes thanks to Robin Ryder's suggestion of using %o%
.
$endgroup$
$begingroup$
Very sorry about that, I should have double checked the example!
$endgroup$
– beirtipol
8 hours ago
1
$begingroup$
Nice use of theFUN
argument ofcombn
! You can get 68 bytes with%o%
instead ofx*3,x*2
.
$endgroup$
– Robin Ryder
7 hours ago
$begingroup$
@RobinRyder duh. I even tried figuring out how to do broadcasting multiplication on the Octave answer!
$endgroup$
– Giuseppe
7 hours ago
add a comment |
$begingroup$
R, 64 bytes
function(n,`!`=utf8ToInt)c(60*n-!"",(!"#%),/")[n<2])
Try it online!
Ports the amazing answer found by Rod.
R, 85 73 68 bytes
function(n)setdiff(0:(60*n),combn(rep(c(0:20%o%1:3,25,50),n),n,sum))
Try it online!
Brute force generates all possible scores with n
darts, then takes the appropriate set difference.
Credit to OrangeCherries' Octave solution for reminding me of combn
.
5 more bytes thanks to Robin Ryder's suggestion of using %o%
.
$endgroup$
R, 64 bytes
function(n,`!`=utf8ToInt)c(60*n-!"",(!"#%),/")[n<2])
Try it online!
Ports the amazing answer found by Rod.
R, 85 73 68 bytes
function(n)setdiff(0:(60*n),combn(rep(c(0:20%o%1:3,25,50),n),n,sum))
Try it online!
Brute force generates all possible scores with n
darts, then takes the appropriate set difference.
Credit to OrangeCherries' Octave solution for reminding me of combn
.
5 more bytes thanks to Robin Ryder's suggestion of using %o%
.
edited 6 hours ago
answered 8 hours ago
GiuseppeGiuseppe
18.7k31461
18.7k31461
$begingroup$
Very sorry about that, I should have double checked the example!
$endgroup$
– beirtipol
8 hours ago
1
$begingroup$
Nice use of theFUN
argument ofcombn
! You can get 68 bytes with%o%
instead ofx*3,x*2
.
$endgroup$
– Robin Ryder
7 hours ago
$begingroup$
@RobinRyder duh. I even tried figuring out how to do broadcasting multiplication on the Octave answer!
$endgroup$
– Giuseppe
7 hours ago
add a comment |
$begingroup$
Very sorry about that, I should have double checked the example!
$endgroup$
– beirtipol
8 hours ago
1
$begingroup$
Nice use of theFUN
argument ofcombn
! You can get 68 bytes with%o%
instead ofx*3,x*2
.
$endgroup$
– Robin Ryder
7 hours ago
$begingroup$
@RobinRyder duh. I even tried figuring out how to do broadcasting multiplication on the Octave answer!
$endgroup$
– Giuseppe
7 hours ago
$begingroup$
Very sorry about that, I should have double checked the example!
$endgroup$
– beirtipol
8 hours ago
$begingroup$
Very sorry about that, I should have double checked the example!
$endgroup$
– beirtipol
8 hours ago
1
1
$begingroup$
Nice use of the
FUN
argument of combn
! You can get 68 bytes with %o%
instead of x*3,x*2
.$endgroup$
– Robin Ryder
7 hours ago
$begingroup$
Nice use of the
FUN
argument of combn
! You can get 68 bytes with %o%
instead of x*3,x*2
.$endgroup$
– Robin Ryder
7 hours ago
$begingroup$
@RobinRyder duh. I even tried figuring out how to do broadcasting multiplication on the Octave answer!
$endgroup$
– Giuseppe
7 hours ago
$begingroup$
@RobinRyder duh. I even tried figuring out how to do broadcasting multiplication on the Octave answer!
$endgroup$
– Giuseppe
7 hours ago
add a comment |
$begingroup$
JavaScript (ES6), 55 bytes
Based on the pattern used by Rod.
n=>[...1121213+[n-1?33:2121242426]].map(x=>s-=x,s=60*n)
Try it online!
$endgroup$
add a comment |
$begingroup$
JavaScript (ES6), 55 bytes
Based on the pattern used by Rod.
n=>[...1121213+[n-1?33:2121242426]].map(x=>s-=x,s=60*n)
Try it online!
$endgroup$
add a comment |
$begingroup$
JavaScript (ES6), 55 bytes
Based on the pattern used by Rod.
n=>[...1121213+[n-1?33:2121242426]].map(x=>s-=x,s=60*n)
Try it online!
$endgroup$
JavaScript (ES6), 55 bytes
Based on the pattern used by Rod.
n=>[...1121213+[n-1?33:2121242426]].map(x=>s-=x,s=60*n)
Try it online!
answered 7 hours ago
ArnauldArnauld
86.3k7102353
86.3k7102353
add a comment |
add a comment |
$begingroup$
Jelly, 19 bytes
20Ż;25×Ɱ3ẎṖœċ⁸§ṪṖḟƊ
Try it online!
$endgroup$
add a comment |
$begingroup$
Jelly, 19 bytes
20Ż;25×Ɱ3ẎṖœċ⁸§ṪṖḟƊ
Try it online!
$endgroup$
add a comment |
$begingroup$
Jelly, 19 bytes
20Ż;25×Ɱ3ẎṖœċ⁸§ṪṖḟƊ
Try it online!
$endgroup$
Jelly, 19 bytes
20Ż;25×Ɱ3ẎṖœċ⁸§ṪṖḟƊ
Try it online!
answered 7 hours ago
Erik the OutgolferErik the Outgolfer
33.9k430107
33.9k430107
add a comment |
add a comment |
$begingroup$
Python 2, 125 bytes
lambda n:set(range(60*n))-set(map(sum,product(sum([range(0,21*j,j)for j in 1,2,3],[25,50]),repeat=n)))
from itertools import*
Try it online!
Python 3, 126 125 bytes
lambda n:{*range(60*n)}-{*map(sum,product([i*j for i in range(21)for j in(1,2,3)]+[25,50],repeat=n))}
from itertools import*
Try it online!
$endgroup$
$begingroup$
On the py3 answer, you can useproduct(sum([[i,i*2,i*3]for i in range(21)],[25,50]),repeat=n)
to save 3 bytes
$endgroup$
– Rod
8 hours ago
add a comment |
$begingroup$
Python 2, 125 bytes
lambda n:set(range(60*n))-set(map(sum,product(sum([range(0,21*j,j)for j in 1,2,3],[25,50]),repeat=n)))
from itertools import*
Try it online!
Python 3, 126 125 bytes
lambda n:{*range(60*n)}-{*map(sum,product([i*j for i in range(21)for j in(1,2,3)]+[25,50],repeat=n))}
from itertools import*
Try it online!
$endgroup$
$begingroup$
On the py3 answer, you can useproduct(sum([[i,i*2,i*3]for i in range(21)],[25,50]),repeat=n)
to save 3 bytes
$endgroup$
– Rod
8 hours ago
add a comment |
$begingroup$
Python 2, 125 bytes
lambda n:set(range(60*n))-set(map(sum,product(sum([range(0,21*j,j)for j in 1,2,3],[25,50]),repeat=n)))
from itertools import*
Try it online!
Python 3, 126 125 bytes
lambda n:{*range(60*n)}-{*map(sum,product([i*j for i in range(21)for j in(1,2,3)]+[25,50],repeat=n))}
from itertools import*
Try it online!
$endgroup$
Python 2, 125 bytes
lambda n:set(range(60*n))-set(map(sum,product(sum([range(0,21*j,j)for j in 1,2,3],[25,50]),repeat=n)))
from itertools import*
Try it online!
Python 3, 126 125 bytes
lambda n:{*range(60*n)}-{*map(sum,product([i*j for i in range(21)for j in(1,2,3)]+[25,50],repeat=n))}
from itertools import*
Try it online!
edited 8 hours ago
answered 8 hours ago
TFeldTFeld
17.3k31453
17.3k31453
$begingroup$
On the py3 answer, you can useproduct(sum([[i,i*2,i*3]for i in range(21)],[25,50]),repeat=n)
to save 3 bytes
$endgroup$
– Rod
8 hours ago
add a comment |
$begingroup$
On the py3 answer, you can useproduct(sum([[i,i*2,i*3]for i in range(21)],[25,50]),repeat=n)
to save 3 bytes
$endgroup$
– Rod
8 hours ago
$begingroup$
On the py3 answer, you can use
product(sum([[i,i*2,i*3]for i in range(21)],[25,50]),repeat=n)
to save 3 bytes$endgroup$
– Rod
8 hours ago
$begingroup$
On the py3 answer, you can use
product(sum([[i,i*2,i*3]for i in range(21)],[25,50]),repeat=n)
to save 3 bytes$endgroup$
– Rod
8 hours ago
add a comment |
$begingroup$
Octave, 91 bytes 73 bytes 71 Bytes
Another brute force method. Not sure about the rule on the 'f=' part for anonymous functions
@(n)setdiff(0:60*n,sum(combnk(repmat([x=0:20,x*2,x*3,25,50],1,n),n),2))
Down to 73 Bytes thanks to Giuseppe
Down to 71 Bytes by replacing nchoosek with combnk
Try it online!
$endgroup$
add a comment |
$begingroup$
Octave, 91 bytes 73 bytes 71 Bytes
Another brute force method. Not sure about the rule on the 'f=' part for anonymous functions
@(n)setdiff(0:60*n,sum(combnk(repmat([x=0:20,x*2,x*3,25,50],1,n),n),2))
Down to 73 Bytes thanks to Giuseppe
Down to 71 Bytes by replacing nchoosek with combnk
Try it online!
$endgroup$
add a comment |
$begingroup$
Octave, 91 bytes 73 bytes 71 Bytes
Another brute force method. Not sure about the rule on the 'f=' part for anonymous functions
@(n)setdiff(0:60*n,sum(combnk(repmat([x=0:20,x*2,x*3,25,50],1,n),n),2))
Down to 73 Bytes thanks to Giuseppe
Down to 71 Bytes by replacing nchoosek with combnk
Try it online!
$endgroup$
Octave, 91 bytes 73 bytes 71 Bytes
Another brute force method. Not sure about the rule on the 'f=' part for anonymous functions
@(n)setdiff(0:60*n,sum(combnk(repmat([x=0:20,x*2,x*3,25,50],1,n),n),2))
Down to 73 Bytes thanks to Giuseppe
Down to 71 Bytes by replacing nchoosek with combnk
Try it online!
edited 7 hours ago
answered 8 hours ago
OrangeCherriesOrangeCherries
1014
1014
add a comment |
add a comment |
$begingroup$
MATL, 25 bytes
:!21:q*25tEvGZ^!stX>Q:qX~
Try it online!
Explanation
Brute force approach.
:! % Implicit input n. Push column vector [1;2;...;n]
21:q % Push row vector [0 1 ... 20]
* % Multiply with broadcast. Gives a matrix with all products
25 % Push 25
tE % Duplicate, double: gives 50
v % Concatenate everything into a column vector
GZ^ % Cartesian power with n. Gives a matrix with each n-tuple on a row
!s % Sum of each row
tX> % Duplicate, maximum. This gives 60*n
Q:q % Push row vector [0 1 ... 60*n]
X~ % Symmetric difference. Implicit display
$endgroup$
add a comment |
$begingroup$
MATL, 25 bytes
:!21:q*25tEvGZ^!stX>Q:qX~
Try it online!
Explanation
Brute force approach.
:! % Implicit input n. Push column vector [1;2;...;n]
21:q % Push row vector [0 1 ... 20]
* % Multiply with broadcast. Gives a matrix with all products
25 % Push 25
tE % Duplicate, double: gives 50
v % Concatenate everything into a column vector
GZ^ % Cartesian power with n. Gives a matrix with each n-tuple on a row
!s % Sum of each row
tX> % Duplicate, maximum. This gives 60*n
Q:q % Push row vector [0 1 ... 60*n]
X~ % Symmetric difference. Implicit display
$endgroup$
add a comment |
$begingroup$
MATL, 25 bytes
:!21:q*25tEvGZ^!stX>Q:qX~
Try it online!
Explanation
Brute force approach.
:! % Implicit input n. Push column vector [1;2;...;n]
21:q % Push row vector [0 1 ... 20]
* % Multiply with broadcast. Gives a matrix with all products
25 % Push 25
tE % Duplicate, double: gives 50
v % Concatenate everything into a column vector
GZ^ % Cartesian power with n. Gives a matrix with each n-tuple on a row
!s % Sum of each row
tX> % Duplicate, maximum. This gives 60*n
Q:q % Push row vector [0 1 ... 60*n]
X~ % Symmetric difference. Implicit display
$endgroup$
MATL, 25 bytes
:!21:q*25tEvGZ^!stX>Q:qX~
Try it online!
Explanation
Brute force approach.
:! % Implicit input n. Push column vector [1;2;...;n]
21:q % Push row vector [0 1 ... 20]
* % Multiply with broadcast. Gives a matrix with all products
25 % Push 25
tE % Duplicate, double: gives 50
v % Concatenate everything into a column vector
GZ^ % Cartesian power with n. Gives a matrix with each n-tuple on a row
!s % Sum of each row
tX> % Duplicate, maximum. This gives 60*n
Q:q % Push row vector [0 1 ... 60*n]
X~ % Symmetric difference. Implicit display
answered 5 hours ago
Luis MendoLuis Mendo
76.3k893298
76.3k893298
add a comment |
add a comment |
$begingroup$
Perl 6, 42 bytes
{^60*$_∖[X+] [[|(^21 X*^4),25,50]xx$_,]}
Try it online!
Brute force solution that works out all possible dart values.
$endgroup$
add a comment |
$begingroup$
Perl 6, 42 bytes
{^60*$_∖[X+] [[|(^21 X*^4),25,50]xx$_,]}
Try it online!
Brute force solution that works out all possible dart values.
$endgroup$
add a comment |
$begingroup$
Perl 6, 42 bytes
{^60*$_∖[X+] [[|(^21 X*^4),25,50]xx$_,]}
Try it online!
Brute force solution that works out all possible dart values.
$endgroup$
Perl 6, 42 bytes
{^60*$_∖[X+] [[|(^21 X*^4),25,50]xx$_,]}
Try it online!
Brute force solution that works out all possible dart values.
answered 4 hours ago
Jo KingJo King
29k369134
29k369134
add a comment |
add a comment |
$begingroup$
Perl 6, 39 bytes (37 chars)
This is definitely using a massive sledgehammer but it works. (It doesn't just brute force it, it brutally brute forces it)
{^60*$_∖[X+] (|(^21 X*^4),25,50)xx$_}
Try it online!
Here's an explanation of it:
{ } anonymous block for the
∖ set difference of
^60*$_ - 0 .. max score (60 * throwcount)
[X+] xx$n - the cross addition (throwcount times) of
( ) all possible score values, being
|( X* ) flattened cross multiplication of
^21 ^4 0..20 and 0..3 (for double and triple)
,25,50 and 25 and 50
The X* ^4
cross multiplier generates a lot of duplicate values (there will be 20+ zeros involved and that's before doing the cross addition), but that doesn't cause any problems since we use the set difference ∖
which works with the unique values.
This currently fails for $n == 1
(which should return an empty set), but there is an issue filed and will likely work in future versions. JoKing's version is a teeny bit longer, but works for $n == 1
in current Rakudo.
$endgroup$
$begingroup$
Wow, awkward... My extra bytes are from fixing the n=1 issue (though you can use $_ instead of $^n for -1)
$endgroup$
– Jo King
4 hours ago
1
$begingroup$
@JoKing ha, I don't think there's anything wrong with two people getting virtually the same answer (especially since yours works in current versions versus mine that's currently theoretical) Also, thanks on the $_ , total brainfart on my part
$endgroup$
– guifa
4 hours ago
add a comment |
$begingroup$
Perl 6, 39 bytes (37 chars)
This is definitely using a massive sledgehammer but it works. (It doesn't just brute force it, it brutally brute forces it)
{^60*$_∖[X+] (|(^21 X*^4),25,50)xx$_}
Try it online!
Here's an explanation of it:
{ } anonymous block for the
∖ set difference of
^60*$_ - 0 .. max score (60 * throwcount)
[X+] xx$n - the cross addition (throwcount times) of
( ) all possible score values, being
|( X* ) flattened cross multiplication of
^21 ^4 0..20 and 0..3 (for double and triple)
,25,50 and 25 and 50
The X* ^4
cross multiplier generates a lot of duplicate values (there will be 20+ zeros involved and that's before doing the cross addition), but that doesn't cause any problems since we use the set difference ∖
which works with the unique values.
This currently fails for $n == 1
(which should return an empty set), but there is an issue filed and will likely work in future versions. JoKing's version is a teeny bit longer, but works for $n == 1
in current Rakudo.
$endgroup$
$begingroup$
Wow, awkward... My extra bytes are from fixing the n=1 issue (though you can use $_ instead of $^n for -1)
$endgroup$
– Jo King
4 hours ago
1
$begingroup$
@JoKing ha, I don't think there's anything wrong with two people getting virtually the same answer (especially since yours works in current versions versus mine that's currently theoretical) Also, thanks on the $_ , total brainfart on my part
$endgroup$
– guifa
4 hours ago
add a comment |
$begingroup$
Perl 6, 39 bytes (37 chars)
This is definitely using a massive sledgehammer but it works. (It doesn't just brute force it, it brutally brute forces it)
{^60*$_∖[X+] (|(^21 X*^4),25,50)xx$_}
Try it online!
Here's an explanation of it:
{ } anonymous block for the
∖ set difference of
^60*$_ - 0 .. max score (60 * throwcount)
[X+] xx$n - the cross addition (throwcount times) of
( ) all possible score values, being
|( X* ) flattened cross multiplication of
^21 ^4 0..20 and 0..3 (for double and triple)
,25,50 and 25 and 50
The X* ^4
cross multiplier generates a lot of duplicate values (there will be 20+ zeros involved and that's before doing the cross addition), but that doesn't cause any problems since we use the set difference ∖
which works with the unique values.
This currently fails for $n == 1
(which should return an empty set), but there is an issue filed and will likely work in future versions. JoKing's version is a teeny bit longer, but works for $n == 1
in current Rakudo.
$endgroup$
Perl 6, 39 bytes (37 chars)
This is definitely using a massive sledgehammer but it works. (It doesn't just brute force it, it brutally brute forces it)
{^60*$_∖[X+] (|(^21 X*^4),25,50)xx$_}
Try it online!
Here's an explanation of it:
{ } anonymous block for the
∖ set difference of
^60*$_ - 0 .. max score (60 * throwcount)
[X+] xx$n - the cross addition (throwcount times) of
( ) all possible score values, being
|( X* ) flattened cross multiplication of
^21 ^4 0..20 and 0..3 (for double and triple)
,25,50 and 25 and 50
The X* ^4
cross multiplier generates a lot of duplicate values (there will be 20+ zeros involved and that's before doing the cross addition), but that doesn't cause any problems since we use the set difference ∖
which works with the unique values.
This currently fails for $n == 1
(which should return an empty set), but there is an issue filed and will likely work in future versions. JoKing's version is a teeny bit longer, but works for $n == 1
in current Rakudo.
edited 1 hour ago
answered 4 hours ago
guifaguifa
42126
42126
$begingroup$
Wow, awkward... My extra bytes are from fixing the n=1 issue (though you can use $_ instead of $^n for -1)
$endgroup$
– Jo King
4 hours ago
1
$begingroup$
@JoKing ha, I don't think there's anything wrong with two people getting virtually the same answer (especially since yours works in current versions versus mine that's currently theoretical) Also, thanks on the $_ , total brainfart on my part
$endgroup$
– guifa
4 hours ago
add a comment |
$begingroup$
Wow, awkward... My extra bytes are from fixing the n=1 issue (though you can use $_ instead of $^n for -1)
$endgroup$
– Jo King
4 hours ago
1
$begingroup$
@JoKing ha, I don't think there's anything wrong with two people getting virtually the same answer (especially since yours works in current versions versus mine that's currently theoretical) Also, thanks on the $_ , total brainfart on my part
$endgroup$
– guifa
4 hours ago
$begingroup$
Wow, awkward... My extra bytes are from fixing the n=1 issue (though you can use $_ instead of $^n for -1)
$endgroup$
– Jo King
4 hours ago
$begingroup$
Wow, awkward... My extra bytes are from fixing the n=1 issue (though you can use $_ instead of $^n for -1)
$endgroup$
– Jo King
4 hours ago
1
1
$begingroup$
@JoKing ha, I don't think there's anything wrong with two people getting virtually the same answer (especially since yours works in current versions versus mine that's currently theoretical) Also, thanks on the $_ , total brainfart on my part
$endgroup$
– guifa
4 hours ago
$begingroup$
@JoKing ha, I don't think there's anything wrong with two people getting virtually the same answer (especially since yours works in current versions versus mine that's currently theoretical) Also, thanks on the $_ , total brainfart on my part
$endgroup$
– guifa
4 hours ago
add a comment |
$begingroup$
Jelly, 28 bytes
21Ḷ×þ3R¤;25;50FœċµS€³×60¤R¤ḟ
Try it online!
$endgroup$
add a comment |
$begingroup$
Jelly, 28 bytes
21Ḷ×þ3R¤;25;50FœċµS€³×60¤R¤ḟ
Try it online!
$endgroup$
add a comment |
$begingroup$
Jelly, 28 bytes
21Ḷ×þ3R¤;25;50FœċµS€³×60¤R¤ḟ
Try it online!
$endgroup$
Jelly, 28 bytes
21Ḷ×þ3R¤;25;50FœċµS€³×60¤R¤ḟ
Try it online!
answered 8 hours ago
HyperNeutrinoHyperNeutrino
20.2k441153
20.2k441153
add a comment |
add a comment |
$begingroup$
Charcoal, 36 bytes
I⁺E…wvtsqpmjgkhea_[YS⎇⊖θ⁹¦¹⁷℅ι×⁶⁰⁻θ²
Try it online! Link is to verbose version of code. Uses @Rod's algorithm; brute force would have taken 60 bytes. Works by truncating the string to 9 characters if the input is greater than 1, then taking the ordinals of the characters and adding the appropriate multiple of 60.
$endgroup$
add a comment |
$begingroup$
Charcoal, 36 bytes
I⁺E…wvtsqpmjgkhea_[YS⎇⊖θ⁹¦¹⁷℅ι×⁶⁰⁻θ²
Try it online! Link is to verbose version of code. Uses @Rod's algorithm; brute force would have taken 60 bytes. Works by truncating the string to 9 characters if the input is greater than 1, then taking the ordinals of the characters and adding the appropriate multiple of 60.
$endgroup$
add a comment |
$begingroup$
Charcoal, 36 bytes
I⁺E…wvtsqpmjgkhea_[YS⎇⊖θ⁹¦¹⁷℅ι×⁶⁰⁻θ²
Try it online! Link is to verbose version of code. Uses @Rod's algorithm; brute force would have taken 60 bytes. Works by truncating the string to 9 characters if the input is greater than 1, then taking the ordinals of the characters and adding the appropriate multiple of 60.
$endgroup$
Charcoal, 36 bytes
I⁺E…wvtsqpmjgkhea_[YS⎇⊖θ⁹¦¹⁷℅ι×⁶⁰⁻θ²
Try it online! Link is to verbose version of code. Uses @Rod's algorithm; brute force would have taken 60 bytes. Works by truncating the string to 9 characters if the input is greater than 1, then taking the ordinals of the characters and adding the appropriate multiple of 60.
answered 6 hours ago
NeilNeil
85.3k846183
85.3k846183
add a comment |
add a comment |
$begingroup$
J, 48 bytes
(2&>#35 44,q:@1474249423),60&*-1 4 8 14,q:@13090
Try it online!
Attempted a brute force solution, but was not able to beat this translation of Rod's idea.
$endgroup$
add a comment |
$begingroup$
J, 48 bytes
(2&>#35 44,q:@1474249423),60&*-1 4 8 14,q:@13090
Try it online!
Attempted a brute force solution, but was not able to beat this translation of Rod's idea.
$endgroup$
add a comment |
$begingroup$
J, 48 bytes
(2&>#35 44,q:@1474249423),60&*-1 4 8 14,q:@13090
Try it online!
Attempted a brute force solution, but was not able to beat this translation of Rod's idea.
$endgroup$
J, 48 bytes
(2&>#35 44,q:@1474249423),60&*-1 4 8 14,q:@13090
Try it online!
Attempted a brute force solution, but was not able to beat this translation of Rod's idea.
answered 4 hours ago
JonahJonah
3,80311221
3,80311221
add a comment |
add a comment |
$begingroup$
Perl 5 -n
, 96 bytes
$"=',';@b=map{(25,50,$_,$_*2,$_*3)}0..20;%k=map{(eval,1)}glob"+{@b}"x$_;$k{$_}||say for 0..$_*60
Try it online!
It was optimized for code length rather than run time, so it's kind of slow. It generates a lot of redundant entries for its lookup hash. Running the @b
array through uniq
speeds it up greatly, but costs 5 more bytes, so I didn't do it.
$endgroup$
add a comment |
$begingroup$
Perl 5 -n
, 96 bytes
$"=',';@b=map{(25,50,$_,$_*2,$_*3)}0..20;%k=map{(eval,1)}glob"+{@b}"x$_;$k{$_}||say for 0..$_*60
Try it online!
It was optimized for code length rather than run time, so it's kind of slow. It generates a lot of redundant entries for its lookup hash. Running the @b
array through uniq
speeds it up greatly, but costs 5 more bytes, so I didn't do it.
$endgroup$
add a comment |
$begingroup$
Perl 5 -n
, 96 bytes
$"=',';@b=map{(25,50,$_,$_*2,$_*3)}0..20;%k=map{(eval,1)}glob"+{@b}"x$_;$k{$_}||say for 0..$_*60
Try it online!
It was optimized for code length rather than run time, so it's kind of slow. It generates a lot of redundant entries for its lookup hash. Running the @b
array through uniq
speeds it up greatly, but costs 5 more bytes, so I didn't do it.
$endgroup$
Perl 5 -n
, 96 bytes
$"=',';@b=map{(25,50,$_,$_*2,$_*3)}0..20;%k=map{(eval,1)}glob"+{@b}"x$_;$k{$_}||say for 0..$_*60
Try it online!
It was optimized for code length rather than run time, so it's kind of slow. It generates a lot of redundant entries for its lookup hash. Running the @b
array through uniq
speeds it up greatly, but costs 5 more bytes, so I didn't do it.
edited 1 hour ago
answered 4 hours ago
XcaliXcali
6,088523
6,088523
add a comment |
add a comment |
$begingroup$
Stax, 24 bytes
¿ß☺o↕αg╠╩╬ò▼í¬«¥↕▄í■♣▓î►
Run and debug it
It's pretty slow for n=3, and gets worse from there.
$endgroup$
add a comment |
$begingroup$
Stax, 24 bytes
¿ß☺o↕αg╠╩╬ò▼í¬«¥↕▄í■♣▓î►
Run and debug it
It's pretty slow for n=3, and gets worse from there.
$endgroup$
add a comment |
$begingroup$
Stax, 24 bytes
¿ß☺o↕αg╠╩╬ò▼í¬«¥↕▄í■♣▓î►
Run and debug it
It's pretty slow for n=3, and gets worse from there.
$endgroup$
Stax, 24 bytes
¿ß☺o↕αg╠╩╬ò▼í¬«¥↕▄í■♣▓î►
Run and debug it
It's pretty slow for n=3, and gets worse from there.
answered 1 min ago
recursiverecursive
6,7991427
6,7991427
add a comment |
add a comment |
If this is an answer to a challenge…
…Be sure to follow the challenge specification. However, please refrain from exploiting obvious loopholes. Answers abusing any of the standard loopholes are considered invalid. If you think a specification is unclear or underspecified, comment on the question instead.
…Try to optimize your score. For instance, answers to code-golf challenges should attempt to be as short as possible. You can always include a readable version of the code in addition to the competitive one.
Explanations of your answer make it more interesting to read and are very much encouraged.…Include a short header which indicates the language(s) of your code and its score, as defined by the challenge.
More generally…
…Please make sure to answer the question and provide sufficient detail.
…Avoid asking for help, clarification or responding to other answers (use comments instead).
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f187105%2fimpossible-darts-scores%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
$begingroup$
Apologies for formatting, writing on a phone!
$endgroup$
– beirtipol
8 hours ago
$begingroup$
somewhat related; I think there was another one about finding missing values from a range but I can't seem to find it.
$endgroup$
– Giuseppe
8 hours ago
$begingroup$
Sincere apologies, I pulled those outputs from an answer to the basic question of 3 darts but did not verify! I will update the question!
$endgroup$
– beirtipol
8 hours ago
1
$begingroup$
no worries :-) Looks fine to me!
$endgroup$
– Giuseppe
8 hours ago