ssTTsSTtRrriinInnnnNNNIiinngg
$begingroup$
Challenge
For each character of the string except for the last one, do the following:
Output the current character.
Followed by randomly outputting from the following list a random number of times between 1 and 5 (inclusive):
- The current character
- The next character of the string
- The switchcase version of the character that you are currently on
- The switchcase version of the next character of the string.
Test Cases
String
--> SSSTSStrTrIiinIIngn
, . , . , . Hello world!
--> ,,, .. , ,, .... , , .. .. . HHH HHEeelLlLllooO wwOworOOrrrRllDd!!D
Programming Puzzles and Code Golf
--> PrPPrRrOooooogggRgGraAraaaMMMmmmimMIiininGGgG PPPPuZzZZzZzzZzllLLEEeEsEsssS a aANnNddD C COCoooOOdeDe E GGGoOllFFf
Notes
- You only need to apply the upper/lowercase form of a character if the character is part of the upper/lowercase alphabet (A-Z/a-z).
- Your random function does not need to be uniform but it still needs to have a chance of returning any element in the list given.
- You are allowed to use any standard I/O format.
- You may assume that the length of the input is greater than or equal to two.
- You may assume that the input only consists of ASCII characters.
code-golf random
$endgroup$
add a comment |
$begingroup$
Challenge
For each character of the string except for the last one, do the following:
Output the current character.
Followed by randomly outputting from the following list a random number of times between 1 and 5 (inclusive):
- The current character
- The next character of the string
- The switchcase version of the character that you are currently on
- The switchcase version of the next character of the string.
Test Cases
String
--> SSSTSStrTrIiinIIngn
, . , . , . Hello world!
--> ,,, .. , ,, .... , , .. .. . HHH HHEeelLlLllooO wwOworOOrrrRllDd!!D
Programming Puzzles and Code Golf
--> PrPPrRrOooooogggRgGraAraaaMMMmmmimMIiininGGgG PPPPuZzZZzZzzZzllLLEEeEsEsssS a aANnNddD C COCoooOOdeDe E GGGoOllFFf
Notes
- You only need to apply the upper/lowercase form of a character if the character is part of the upper/lowercase alphabet (A-Z/a-z).
- Your random function does not need to be uniform but it still needs to have a chance of returning any element in the list given.
- You are allowed to use any standard I/O format.
- You may assume that the length of the input is greater than or equal to two.
- You may assume that the input only consists of ASCII characters.
code-golf random
$endgroup$
$begingroup$
In addition to '... does not need to be uniform', I think you probably want to specify that given some input, all finite legal outputs should in principle be possible to generate (otherwise, my non-uniform random integer in [1,2,3,4,5] is always going to be 2, and I'll just output the original string).
$endgroup$
– Chas Brown
4 hours ago
$begingroup$
@ChasBrown Yeah, I'll edit the question
$endgroup$
– MilkyWay90
4 hours ago
add a comment |
$begingroup$
Challenge
For each character of the string except for the last one, do the following:
Output the current character.
Followed by randomly outputting from the following list a random number of times between 1 and 5 (inclusive):
- The current character
- The next character of the string
- The switchcase version of the character that you are currently on
- The switchcase version of the next character of the string.
Test Cases
String
--> SSSTSStrTrIiinIIngn
, . , . , . Hello world!
--> ,,, .. , ,, .... , , .. .. . HHH HHEeelLlLllooO wwOworOOrrrRllDd!!D
Programming Puzzles and Code Golf
--> PrPPrRrOooooogggRgGraAraaaMMMmmmimMIiininGGgG PPPPuZzZZzZzzZzllLLEEeEsEsssS a aANnNddD C COCoooOOdeDe E GGGoOllFFf
Notes
- You only need to apply the upper/lowercase form of a character if the character is part of the upper/lowercase alphabet (A-Z/a-z).
- Your random function does not need to be uniform but it still needs to have a chance of returning any element in the list given.
- You are allowed to use any standard I/O format.
- You may assume that the length of the input is greater than or equal to two.
- You may assume that the input only consists of ASCII characters.
code-golf random
$endgroup$
Challenge
For each character of the string except for the last one, do the following:
Output the current character.
Followed by randomly outputting from the following list a random number of times between 1 and 5 (inclusive):
- The current character
- The next character of the string
- The switchcase version of the character that you are currently on
- The switchcase version of the next character of the string.
Test Cases
String
--> SSSTSStrTrIiinIIngn
, . , . , . Hello world!
--> ,,, .. , ,, .... , , .. .. . HHH HHEeelLlLllooO wwOworOOrrrRllDd!!D
Programming Puzzles and Code Golf
--> PrPPrRrOooooogggRgGraAraaaMMMmmmimMIiininGGgG PPPPuZzZZzZzzZzllLLEEeEsEsssS a aANnNddD C COCoooOOdeDe E GGGoOllFFf
Notes
- You only need to apply the upper/lowercase form of a character if the character is part of the upper/lowercase alphabet (A-Z/a-z).
- Your random function does not need to be uniform but it still needs to have a chance of returning any element in the list given.
- You are allowed to use any standard I/O format.
- You may assume that the length of the input is greater than or equal to two.
- You may assume that the input only consists of ASCII characters.
code-golf random
code-golf random
edited 4 hours ago
MilkyWay90
asked 6 hours ago
MilkyWay90MilkyWay90
639213
639213
$begingroup$
In addition to '... does not need to be uniform', I think you probably want to specify that given some input, all finite legal outputs should in principle be possible to generate (otherwise, my non-uniform random integer in [1,2,3,4,5] is always going to be 2, and I'll just output the original string).
$endgroup$
– Chas Brown
4 hours ago
$begingroup$
@ChasBrown Yeah, I'll edit the question
$endgroup$
– MilkyWay90
4 hours ago
add a comment |
$begingroup$
In addition to '... does not need to be uniform', I think you probably want to specify that given some input, all finite legal outputs should in principle be possible to generate (otherwise, my non-uniform random integer in [1,2,3,4,5] is always going to be 2, and I'll just output the original string).
$endgroup$
– Chas Brown
4 hours ago
$begingroup$
@ChasBrown Yeah, I'll edit the question
$endgroup$
– MilkyWay90
4 hours ago
$begingroup$
In addition to '... does not need to be uniform', I think you probably want to specify that given some input, all finite legal outputs should in principle be possible to generate (otherwise, my non-uniform random integer in [1,2,3,4,5] is always going to be 2, and I'll just output the original string).
$endgroup$
– Chas Brown
4 hours ago
$begingroup$
In addition to '... does not need to be uniform', I think you probably want to specify that given some input, all finite legal outputs should in principle be possible to generate (otherwise, my non-uniform random integer in [1,2,3,4,5] is always going to be 2, and I'll just output the original string).
$endgroup$
– Chas Brown
4 hours ago
$begingroup$
@ChasBrown Yeah, I'll edit the question
$endgroup$
– MilkyWay90
4 hours ago
$begingroup$
@ChasBrown Yeah, I'll edit the question
$endgroup$
– MilkyWay90
4 hours ago
add a comment |
6 Answers
6
active
oldest
votes
$begingroup$
Gaia, 21 bytes
ṅ@ṇ+†⟨(₌¤:~+ṛ5ṛ&⟩¦$
Try it online!
ṅ | delete the first character from the input
@ṇ | push the input again and delete the last character
+† | concatenate together, so for example 'abc' 'bcd' becomes ['ab' 'bc' 'cd']
⟨ ⟩¦ | for each of the elements, do:
(₌ | take the first character and push again
¤ | swap
: | dup
~ | swap case
+ | combine strings
ṛ | select a character at random
5ṛ | select a random integer from [1..5]
& | run-length decode
$ | convert to string
$endgroup$
add a comment |
$begingroup$
Bash, 150 bytes
Have done very little golf bashing and trying to improve my bash, so any comments welcome.
for((i=0;i<${#1}-1;i++));do
c=${1:$i:1}
n=${1:$((i+1)):1}
a=($n ${c,} ${c^} ${n,} ${n^})
shuf -e ${a[@]} -n "$(shuf -i 1-5 -n 1)"|xargs printf %s
done
Try it online!
Code is straightforward loop through chars setting current c
and next n
character, then creating an array of the 4 possibilities, repeating one of them so there's exactly 5. Next we shuffle that array, and then choose n elements from it, where n itself is random between 1 and 5.
$endgroup$
add a comment |
$begingroup$
APL (dzaima/APL), 19 bytes
Anonymous tacit prefix function.
∊2(⊣,{?5⍴4}⊇,,-⍤,)/
Try it online!
2(
…)/
apply the following infix tacit function between each character pair:
-
the switchcase
⍤
of
,
the concatenation of the pair
,,
prepend the concatenation of the pair to that
{
…}⊇
pick the following elements from that:
5⍴4
five fours
?
random indices for those
∊
ϵnlist (flatten)
$endgroup$
add a comment |
$begingroup$
Charcoal, 27 bytes
FLθ«F∧ι⊕‽⁵‽⭆✂θ⊖ι⊕ι¹⁺↥λ↧λ§θι
Try it online! Link is to verbose version of code. Explanation:
FLθ«
Loop over all of the indices of the input string.
F∧ι⊕‽⁵
Except for the first index, loop over a random number from 1 to 5 inclusive...
‽⭆✂θ⊖ι⊕ι¹⁺↥λ↧λ
... extract the previous and next characters from the string, take the upper and lower case versions, and pick a random character of the four.
§θι
Print the character at the current index.
$endgroup$
add a comment |
$begingroup$
Japt v2.0a0, 43 bytes
s0UÊÉ)rÈ+Y+(C=[Yu Yv T=UgZÄ v Tu] cMq5 £C ö
After a month of so of Japt, I'm still not very good at it.
Try it
$endgroup$
add a comment |
$begingroup$
Python 2, 107 bytes
f=lambda s:s and s[0]+''.join(sample((s[:2]+s[:2].swapcase())*5,randint(1,5)))+f(s[1:])
from random import*
Try it online!
$endgroup$
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["\$", "\$"]]);
});
});
}, "mathjax-editing");
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%2f182559%2fssttssttrrriininnnnnnniiinngg%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
6 Answers
6
active
oldest
votes
6 Answers
6
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
Gaia, 21 bytes
ṅ@ṇ+†⟨(₌¤:~+ṛ5ṛ&⟩¦$
Try it online!
ṅ | delete the first character from the input
@ṇ | push the input again and delete the last character
+† | concatenate together, so for example 'abc' 'bcd' becomes ['ab' 'bc' 'cd']
⟨ ⟩¦ | for each of the elements, do:
(₌ | take the first character and push again
¤ | swap
: | dup
~ | swap case
+ | combine strings
ṛ | select a character at random
5ṛ | select a random integer from [1..5]
& | run-length decode
$ | convert to string
$endgroup$
add a comment |
$begingroup$
Gaia, 21 bytes
ṅ@ṇ+†⟨(₌¤:~+ṛ5ṛ&⟩¦$
Try it online!
ṅ | delete the first character from the input
@ṇ | push the input again and delete the last character
+† | concatenate together, so for example 'abc' 'bcd' becomes ['ab' 'bc' 'cd']
⟨ ⟩¦ | for each of the elements, do:
(₌ | take the first character and push again
¤ | swap
: | dup
~ | swap case
+ | combine strings
ṛ | select a character at random
5ṛ | select a random integer from [1..5]
& | run-length decode
$ | convert to string
$endgroup$
add a comment |
$begingroup$
Gaia, 21 bytes
ṅ@ṇ+†⟨(₌¤:~+ṛ5ṛ&⟩¦$
Try it online!
ṅ | delete the first character from the input
@ṇ | push the input again and delete the last character
+† | concatenate together, so for example 'abc' 'bcd' becomes ['ab' 'bc' 'cd']
⟨ ⟩¦ | for each of the elements, do:
(₌ | take the first character and push again
¤ | swap
: | dup
~ | swap case
+ | combine strings
ṛ | select a character at random
5ṛ | select a random integer from [1..5]
& | run-length decode
$ | convert to string
$endgroup$
Gaia, 21 bytes
ṅ@ṇ+†⟨(₌¤:~+ṛ5ṛ&⟩¦$
Try it online!
ṅ | delete the first character from the input
@ṇ | push the input again and delete the last character
+† | concatenate together, so for example 'abc' 'bcd' becomes ['ab' 'bc' 'cd']
⟨ ⟩¦ | for each of the elements, do:
(₌ | take the first character and push again
¤ | swap
: | dup
~ | swap case
+ | combine strings
ṛ | select a character at random
5ṛ | select a random integer from [1..5]
& | run-length decode
$ | convert to string
answered 4 hours ago
GiuseppeGiuseppe
17.3k31152
17.3k31152
add a comment |
add a comment |
$begingroup$
Bash, 150 bytes
Have done very little golf bashing and trying to improve my bash, so any comments welcome.
for((i=0;i<${#1}-1;i++));do
c=${1:$i:1}
n=${1:$((i+1)):1}
a=($n ${c,} ${c^} ${n,} ${n^})
shuf -e ${a[@]} -n "$(shuf -i 1-5 -n 1)"|xargs printf %s
done
Try it online!
Code is straightforward loop through chars setting current c
and next n
character, then creating an array of the 4 possibilities, repeating one of them so there's exactly 5. Next we shuffle that array, and then choose n elements from it, where n itself is random between 1 and 5.
$endgroup$
add a comment |
$begingroup$
Bash, 150 bytes
Have done very little golf bashing and trying to improve my bash, so any comments welcome.
for((i=0;i<${#1}-1;i++));do
c=${1:$i:1}
n=${1:$((i+1)):1}
a=($n ${c,} ${c^} ${n,} ${n^})
shuf -e ${a[@]} -n "$(shuf -i 1-5 -n 1)"|xargs printf %s
done
Try it online!
Code is straightforward loop through chars setting current c
and next n
character, then creating an array of the 4 possibilities, repeating one of them so there's exactly 5. Next we shuffle that array, and then choose n elements from it, where n itself is random between 1 and 5.
$endgroup$
add a comment |
$begingroup$
Bash, 150 bytes
Have done very little golf bashing and trying to improve my bash, so any comments welcome.
for((i=0;i<${#1}-1;i++));do
c=${1:$i:1}
n=${1:$((i+1)):1}
a=($n ${c,} ${c^} ${n,} ${n^})
shuf -e ${a[@]} -n "$(shuf -i 1-5 -n 1)"|xargs printf %s
done
Try it online!
Code is straightforward loop through chars setting current c
and next n
character, then creating an array of the 4 possibilities, repeating one of them so there's exactly 5. Next we shuffle that array, and then choose n elements from it, where n itself is random between 1 and 5.
$endgroup$
Bash, 150 bytes
Have done very little golf bashing and trying to improve my bash, so any comments welcome.
for((i=0;i<${#1}-1;i++));do
c=${1:$i:1}
n=${1:$((i+1)):1}
a=($n ${c,} ${c^} ${n,} ${n^})
shuf -e ${a[@]} -n "$(shuf -i 1-5 -n 1)"|xargs printf %s
done
Try it online!
Code is straightforward loop through chars setting current c
and next n
character, then creating an array of the 4 possibilities, repeating one of them so there's exactly 5. Next we shuffle that array, and then choose n elements from it, where n itself is random between 1 and 5.
edited 1 hour ago
answered 1 hour ago
JonahJonah
2,4811017
2,4811017
add a comment |
add a comment |
$begingroup$
APL (dzaima/APL), 19 bytes
Anonymous tacit prefix function.
∊2(⊣,{?5⍴4}⊇,,-⍤,)/
Try it online!
2(
…)/
apply the following infix tacit function between each character pair:
-
the switchcase
⍤
of
,
the concatenation of the pair
,,
prepend the concatenation of the pair to that
{
…}⊇
pick the following elements from that:
5⍴4
five fours
?
random indices for those
∊
ϵnlist (flatten)
$endgroup$
add a comment |
$begingroup$
APL (dzaima/APL), 19 bytes
Anonymous tacit prefix function.
∊2(⊣,{?5⍴4}⊇,,-⍤,)/
Try it online!
2(
…)/
apply the following infix tacit function between each character pair:
-
the switchcase
⍤
of
,
the concatenation of the pair
,,
prepend the concatenation of the pair to that
{
…}⊇
pick the following elements from that:
5⍴4
five fours
?
random indices for those
∊
ϵnlist (flatten)
$endgroup$
add a comment |
$begingroup$
APL (dzaima/APL), 19 bytes
Anonymous tacit prefix function.
∊2(⊣,{?5⍴4}⊇,,-⍤,)/
Try it online!
2(
…)/
apply the following infix tacit function between each character pair:
-
the switchcase
⍤
of
,
the concatenation of the pair
,,
prepend the concatenation of the pair to that
{
…}⊇
pick the following elements from that:
5⍴4
five fours
?
random indices for those
∊
ϵnlist (flatten)
$endgroup$
APL (dzaima/APL), 19 bytes
Anonymous tacit prefix function.
∊2(⊣,{?5⍴4}⊇,,-⍤,)/
Try it online!
2(
…)/
apply the following infix tacit function between each character pair:
-
the switchcase
⍤
of
,
the concatenation of the pair
,,
prepend the concatenation of the pair to that
{
…}⊇
pick the following elements from that:
5⍴4
five fours
?
random indices for those
∊
ϵnlist (flatten)
answered 6 hours ago
AdámAdám
28.8k276207
28.8k276207
add a comment |
add a comment |
$begingroup$
Charcoal, 27 bytes
FLθ«F∧ι⊕‽⁵‽⭆✂θ⊖ι⊕ι¹⁺↥λ↧λ§θι
Try it online! Link is to verbose version of code. Explanation:
FLθ«
Loop over all of the indices of the input string.
F∧ι⊕‽⁵
Except for the first index, loop over a random number from 1 to 5 inclusive...
‽⭆✂θ⊖ι⊕ι¹⁺↥λ↧λ
... extract the previous and next characters from the string, take the upper and lower case versions, and pick a random character of the four.
§θι
Print the character at the current index.
$endgroup$
add a comment |
$begingroup$
Charcoal, 27 bytes
FLθ«F∧ι⊕‽⁵‽⭆✂θ⊖ι⊕ι¹⁺↥λ↧λ§θι
Try it online! Link is to verbose version of code. Explanation:
FLθ«
Loop over all of the indices of the input string.
F∧ι⊕‽⁵
Except for the first index, loop over a random number from 1 to 5 inclusive...
‽⭆✂θ⊖ι⊕ι¹⁺↥λ↧λ
... extract the previous and next characters from the string, take the upper and lower case versions, and pick a random character of the four.
§θι
Print the character at the current index.
$endgroup$
add a comment |
$begingroup$
Charcoal, 27 bytes
FLθ«F∧ι⊕‽⁵‽⭆✂θ⊖ι⊕ι¹⁺↥λ↧λ§θι
Try it online! Link is to verbose version of code. Explanation:
FLθ«
Loop over all of the indices of the input string.
F∧ι⊕‽⁵
Except for the first index, loop over a random number from 1 to 5 inclusive...
‽⭆✂θ⊖ι⊕ι¹⁺↥λ↧λ
... extract the previous and next characters from the string, take the upper and lower case versions, and pick a random character of the four.
§θι
Print the character at the current index.
$endgroup$
Charcoal, 27 bytes
FLθ«F∧ι⊕‽⁵‽⭆✂θ⊖ι⊕ι¹⁺↥λ↧λ§θι
Try it online! Link is to verbose version of code. Explanation:
FLθ«
Loop over all of the indices of the input string.
F∧ι⊕‽⁵
Except for the first index, loop over a random number from 1 to 5 inclusive...
‽⭆✂θ⊖ι⊕ι¹⁺↥λ↧λ
... extract the previous and next characters from the string, take the upper and lower case versions, and pick a random character of the four.
§θι
Print the character at the current index.
answered 6 hours ago
NeilNeil
82.3k745178
82.3k745178
add a comment |
add a comment |
$begingroup$
Japt v2.0a0, 43 bytes
s0UÊÉ)rÈ+Y+(C=[Yu Yv T=UgZÄ v Tu] cMq5 £C ö
After a month of so of Japt, I'm still not very good at it.
Try it
$endgroup$
add a comment |
$begingroup$
Japt v2.0a0, 43 bytes
s0UÊÉ)rÈ+Y+(C=[Yu Yv T=UgZÄ v Tu] cMq5 £C ö
After a month of so of Japt, I'm still not very good at it.
Try it
$endgroup$
add a comment |
$begingroup$
Japt v2.0a0, 43 bytes
s0UÊÉ)rÈ+Y+(C=[Yu Yv T=UgZÄ v Tu] cMq5 £C ö
After a month of so of Japt, I'm still not very good at it.
Try it
$endgroup$
Japt v2.0a0, 43 bytes
s0UÊÉ)rÈ+Y+(C=[Yu Yv T=UgZÄ v Tu] cMq5 £C ö
After a month of so of Japt, I'm still not very good at it.
Try it
answered 57 mins ago
Embodiment of IgnoranceEmbodiment of Ignorance
2,298126
2,298126
add a comment |
add a comment |
$begingroup$
Python 2, 107 bytes
f=lambda s:s and s[0]+''.join(sample((s[:2]+s[:2].swapcase())*5,randint(1,5)))+f(s[1:])
from random import*
Try it online!
$endgroup$
add a comment |
$begingroup$
Python 2, 107 bytes
f=lambda s:s and s[0]+''.join(sample((s[:2]+s[:2].swapcase())*5,randint(1,5)))+f(s[1:])
from random import*
Try it online!
$endgroup$
add a comment |
$begingroup$
Python 2, 107 bytes
f=lambda s:s and s[0]+''.join(sample((s[:2]+s[:2].swapcase())*5,randint(1,5)))+f(s[1:])
from random import*
Try it online!
$endgroup$
Python 2, 107 bytes
f=lambda s:s and s[0]+''.join(sample((s[:2]+s[:2].swapcase())*5,randint(1,5)))+f(s[1:])
from random import*
Try it online!
answered 45 mins ago
Chas BrownChas Brown
5,0791523
5,0791523
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%2f182559%2fssttssttrrriininnnnnnniiinngg%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$
In addition to '... does not need to be uniform', I think you probably want to specify that given some input, all finite legal outputs should in principle be possible to generate (otherwise, my non-uniform random integer in [1,2,3,4,5] is always going to be 2, and I'll just output the original string).
$endgroup$
– Chas Brown
4 hours ago
$begingroup$
@ChasBrown Yeah, I'll edit the question
$endgroup$
– MilkyWay90
4 hours ago