EverydayFun icon indicating copy to clipboard operation
EverydayFun copied to clipboard

Added my fave Mark Twain quote

Open gitdagray opened this issue 4 years ago • 6 comments

gitdagray avatar Oct 04 '20 23:10 gitdagray

I felt compelled to contribute some code. Please disregard the surpriseMe functionality and keep the quote if preferred. However, I thought it might be a nice addition. Thanks.

gitdagray avatar Oct 05 '20 00:10 gitdagray

I felt compelled to contribute some code. Please disregard the surpriseMe functionality and keep the quote if preferred. However, I thought it might be a nice addition. Thanks.

@gitdagray It is indeed a good idea, but, i think there is a mistake in your code. In surpriseMe function, you are supposed to return anything (a riddle , a joke or a quote), but, instead you are returning a complete list of one of them. Correct me, if I am wrong.

tachodril avatar Oct 05 '20 09:10 tachodril

Sorry for any confusion, but it only returns one of them. I get one random item of each type, and then I add those three items to the array "items". I then use the same random formula you used in the getRandomItem function, but in this case, it is just selecting one of the three items in the array "items" that I built in the surpriseMe function. It may not have been confusing it I named the array something else like singleItems. I also tested it in the test.js file. Please run the test to see the results. Thanks!

gitdagray avatar Oct 05 '20 12:10 gitdagray

Sorry for any confusion, but it only returns one of them. I get one random item of each type, and then I add those three items to the array "items". I then use the same random formula you used in the getRandomItem function, but in this case, it is just selecting one of the three items in the array "items" that I built in the surpriseMe function. It may not have been confusing it I named the array something else like singleItems. I also tested it in the test.js file. Please run the test to see the results. Thanks!

@gitdagray Yeah, I get it now what you did there. There is no mistake!!

tachodril avatar Oct 05 '20 14:10 tachodril

Thanks! Please accept either just the quote or the full contribution to add to my Hacktoberfest total. Much appreciated :)

gitdagray avatar Oct 08 '20 18:10 gitdagray

Thanks! Please accept either just the quote or the full contribution to add to my Hacktoberfest total. Much appreciated :)

I have labeled your PR, so your contribution will be considered in hacktoberfest. Will definitely merge your PR, just a little later (sorry about that)!!

tachodril avatar Oct 08 '20 18:10 tachodril