Votre dernière mission consistait à compter le nombre de chiffres pairs du vecteur x avec le moins de code possible (étant bien entendu que les espaces, les indentations et les retours à la ligne ne sont pas comptés comme des caractères).
x <- sample(0:9, 100, TRUE)
La meilleure réponse possible était :
sum(! x %% 2)
... et vous êtes 14 à l'avoir trouvée. Dans l'ordre d'arrivée : @thedudeparis, @_antoineb, @_pvictorr, @davidgohel, @loicmolinari, @AlekVladNevski @privefl, @basiliximAb @dickoah, @ClementinC @StephaneOrlins, @claramorganexxx (ahem..), @francois_ls et @After_Eight. Bravo à toutes et à tous !
Comme vous êtes bons, on va augmenter la difficulté. Votre mission, si vous l'acceptez, consiste à coder une fonction syracuse qui renvoie la suite de Syracuse de n'importe quel entier x jusqu'à ce qu'elle atteigne 1. En d'autres termes, nous cherchons une fonction de type :
syracuse = function(x) {
# faire quelque chose...
}
De telle sorte que :
> syracuse(42) [1] 42 21 64 32 16 8 4 2 1
Mais comme ça, c'est trop facile, vous allez faire ça sans boucle (ni for ni while ni repeat !).
It reveals how nicely you perceive this subject.
RépondreSupprimerBookmarked this website page, will come back for extra articles.
RépondreSupprimerRattling wonderful visual appeal on this web site, I’d value it 10 over 10.
RépondreSupprimerThanks for your marvelous posting! I certainly enjoyed reading this article... MM
RépondreSupprimerWonderful article. It's very useful. I think it's one of the most informative Websites... MM
RépondreSupprimerI have taken this blog that written very well. I like you. I'll support you... MM
RépondreSupprimerSuch a valuable post. I like it very much, Love your skills in writing Thanks... MM
RépondreSupprimerI found so many interesting stuff in this blog. Really its great article. Keep it up... MM
RépondreSupprimer
RépondreSupprimerI am happy to find this way of writing the post. Thank you for this useful info
RépondreSupprimerReally amazed with your writing talent. Thanks for sharing, Love your works
RépondreSupprimerIt’s really a cool and useful piece of info.
RépondreSupprimerWow, happy to see this awesome post. Thanks for sharing a great information
RépondreSupprimerPretty! This has been an extremely wonderful post. Thank you for supplying this info.
This article is super helpful for parents struggling to keep toddlers engaged!..YY
RépondreSupprimerThank you for always writing good things..YY
RépondreSupprimerIt was a great show , really enjoyed it..YY
RépondreSupprimerThanks for sharing your info. I really appreciate your efforts..YY
RépondreSupprimer
RépondreSupprimerI am waiting for your next post thanks once again..YY
Fantastic post..YY
RépondreSupprimerI’d be very grateful if you could elaborate a little bit more. Kudos!..YY
RépondreSupprimerGreat points you made there in your article. Thanks for all your help in making a change in the world..YY
RépondreSupprimer
RépondreSupprimerGood blog information. I am impress with your writing skill. Thank you for this
RépondreSupprimerI am always searching this type of blog post. I hope I will see this again soon.
RépondreSupprimerVery interesting to read this blog. I enjoy your work! Its wonderful, Thanks for this.
RépondreSupprimerWow It is a great contents that I ever seen
Hello. fantastic work. I didn't anticipate this. This is an amazing tale. Thanks!..YY
RépondreSupprimerHello. fantastic work. I didn't anticipate this. This is an amazing tale. Thanks!..YY
RépondreSupprimerHi there, You have done an excellent job. I will certainly digg it and personally suggest to my friends..YY
RépondreSupprimerThis is really helpful post and very informative there is no doubt about it..YY
RépondreSupprimerWrite more high-quality articles. I support you..YY
RépondreSupprimerThanks for sharing with us this important Content.
RépondreSupprimerI feel strongly about it and really enjoyed learning more about this topic..YY
RépondreSupprimerKeep up the good writing. please visit our beautiful website, spread the love, thankyou!..YY
RépondreSupprimerFantastic website Lots of useful information here..YY
RépondreSupprimer