-
-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Approvable solutions for Acronym #11
Comments
This is great! Moving to the |
@iHiD Acronym is going to be moved shortly. And Resistor Color Duo is currently the first core after TwoFer, but the series is still experimental. Meaning: we need to evaluate the series as a whole and each exercise in the series. Plus since it's a new exercise, it is still 'volatile' and I expect it to change a few times in the next weeks and months. |
@F3PiX We need to think about this. As a lot of effort is going into writing analyzers for these exercises, we need to co-ordinate amongst the tracks that have analyzers to ensure we're not wasting a lot of energy. Something to chat about on Wed maybe. |
@iHiD Did the work on Acronym already start? Because then I'll find a different solution. |
@iHiD
Per your request, here are the approvables for Acronym.
(Note that Acronym is not meeting all the requirements for a Level 1 exercise, (it's controversial, and it requires too many iterations to get it right), so when I find a better candidate it will move up in the track.)
Things that will be addressed later in the track, not on this level:
class
ormodule
: both approvable without commentself.
orclass << self
: both approvable without commentGood solutions with split are auto-approvable; it would be nice to add a comment to investigate
scan
with regex/\b\w/
.Good solutions that have a too generic or typing name (
input
,string
,str
) for the param should preferrably have a comment about naming things, suggestingwords
orphrase
.One complete solution, approvable:
Other approvables, method body only:
words.tr('-', ' ').split.map { |word| word.chr }.join.upcase
Symbol#to_proc
is not relevant to this level, so the long form is auto-approvable.{|word|...}
) unless it's inconsistent :{ |word| do_things}
words.scan(/\b[[:alpha:]]/).join.upcase
/\b\w/
,/\b[a-zA-Z]/
,/\b[a-z]/i
words.split(/[ -]/).map(&:chr).join.upcase
split(/\W/)
,Especially for this exercise, it may be interesting to see if non-approvables are easier to spot:
word[0]
within the block orword.slice(0)
upcase
is not at the end of the chain (note: there's one approvable that hasupcase
earlier).gsub
each
join(
The text was updated successfully, but these errors were encountered: