@primo @JoKing Is the behaviour of [\R+] 1…10 in perl6 to be expected. I would've thought that it would be the same as [\+] 1…10 since + and R+ are the same?
The Typical Way to Make an Acronym Out of a Phrase Is to Take the First Letter of Each Word: TTWMAOPITFLEW. howeveR, sometimEs, you can make an acronym of random leTters In a seNtence such As like this: RETINA. The only condition is that the letters have to be in the correct order. For instance:
...
Get the number of upvotes of your own answer
Write a piece of code which makes a request to codegolf.stackexchange.com and prints the, up to date, number of upvotes to the specific answer in which you've posted that piece of code.
As a test case I'll post a (poor!) answer below (obviously only ...
Is it an Acronym?
This challenge is trivially simplified (not copied verbatim, that will be disrespectful to the original question-maker) from @caird coinheringaahing's deleted sandbox post (I can't remember the title, is it "Is it an acronym"?)
I don't remember the whole post. I think the post...
@H.PWiz That's weird... Some testing, it seems the junction operators &,| and ^ work as we expected, alongside the unlikely =. Even custom functions reverse the list rather than the order of arguments
Right. It does seem like it could be occasionally useful like sum [\Rdiv] 99…1,10**100. Since it's easier to put the 10**100 on the right. (At least I don't know how the to put it at the start of the list)
I tried to use this on golf.shinh.org, but their perl6 is old, and it doesn't reverse the list
@JoKing It seems that it's because R reverses the associativity. And then, that [\f] a,b,c,d appears to just keep track of intermediate computations of a f b f c f d
The Boyer–Moore majority vote algorithm is an algorithm for finding the majority of a sequence of elements using linear time and constant space. It is named after Robert S. Boyer and J Strother Moore, who published it in 1981, and is a prototypical example of a streaming algorithm.
In its simplest form, the algorithm finds a majority element, if there is one: that is, an element that occurs repeatedly for more than half of the elements of the input.
However, if there is no majority, the algorithm will not detect that fact, and will still output one of the elements.
A version of the algorithm that...
@Cowsquack Oh, BTW since you're in here, I've got a pretty big overhaul for V coming soon. It should fix that one bug you reported (about xterm), and hopefully make it work on OS X
Numbers Decrease while Letters Increase
code-golf string number
Randomly inspired by Numbers Increase While Letters Decrease
Given a list of mixed letters and integers (e.g., ['a', 2, 3, 'b']) increase the letters by one position in the alphabet (wrapping at z to a) and decrease the numbers by...