DEV Community 👩‍💻👨‍💻

Pascal Thormeier
Pascal Thormeier

Posted on

dev.to codes! Collaborative coding experiment: The most liked comment picks the next line of code, day 4

Another 24 hours have passed and we're now on day 4. @manthanbhatt has posted today's most liked comment, adding a new part to whatever we're building here, Congrats!

Please note that the language of choice was Ruby! Any comment in another language might need some translation.

This experiment is inspired by a post on the ProgrammerHumor subreddit, where the original author did this exact thing: The most liked comment after 24 hours picks the next line of code.

The rules:

  • Nothing that's against any applicable law
  • Nothing that's against the community code of conduct, terms of use, or privacy policy
  • No leaking of personal information of anyone
  • No malware/ransomware/viruses/etc.
  • Keep it civil
  • (To be expanded, depending on the case)

Our code so far:

emotions = ["🥲", "🥰", "🥺", "😫", "🤬", "😞", "😅", "😊", "😰"]
how_i_feel_right_now = emotions.sample
if how_i_feel_right_now === "😊"
    letsDoThis()
end
Enter fullscreen mode Exit fullscreen mode

(I had to adjust the code a bit for it to be valid Ruby.)

See you in 24 hours!

Top comments (5)

Collapse
 
rafaelhashimoto profile image
RafaelHashimoto

Sorry if my big PR 😅

def lets_do_this
  # things a person can do that will change his humor
  what_have_i_done = "🥲" if big_mistakes
  how_i_feel_right_now =  what_have_i_done
end

def big_mistakes
  deploy_on_friday() || buy_twitter()
end

def buy_twitter
  raise AquisitionError, "I won't buy it" if user_base_has_bots?
rescue AquisitionError => e
   puts e.message
   true # because you can't step back
end

def user_base_has_bots?
  true # well... yes
end
Enter fullscreen mode Exit fullscreen mode
Collapse
 
janmpeterka profile image
Jan Peterka
def letsDoThis
    if procrastination_index < 1.5
        selected_activity = my_neverending_list_of_tasks.sample
    else
        selected_activity = nil
        how_i_feel_right_now = emotions.sample
    endif
end
Enter fullscreen mode Exit fullscreen mode
Collapse
 
nathannosudo profile image
Nathan Orris

puts 'Now, this is a story all about how
My life got flipped-turned upside down
And I'd like to take a minute
Just sit right there
I'll tell you how I became the prince of a town called Bel-Air
In West Philadelphia born and raised
On the playground was where I spent most of my days
Chillin' out, maxin', relaxin', all cool
And all shootin' some b-ball outside of the school
When a couple of guys who were up to no good
Started making trouble in my neighborhood
I got in one little fight and my mom got scared
She said, "You're movin' with your auntie and uncle in Bel-Air"
I begged and pleaded with her day after day
But she packed my suitcase and sent me on my way
She gave me a kiss and then she gave me my ticket
I put my Walkman on and said, "I might as well kick it"
First class, yo this is bad
Drinking orange juice out of a champagne glass
Is this what the people of Bel-Air living like?
Hmm, this might be alright
But wait, I hear they're prissy, bourgeois, all that
Is this the type of place that they just send this cool cat?
I don't think so
I'll see when I get there
I hope they're prepared for the prince of Bel-Air
Well, the plane landed and when I came out
There was a dude who looked like a cop standing there with my name out
I ain't trying to get arrested yet, I just got here
I sprang with the quickness like lightning, disappeared
I whistled for a cab and when it came near
The license plate said, "Fresh" and it had dice in the mirror
If anything I could say that this cab was rare
But I thought "Nah, forget it, yo, holmes to Bel Air"
I pulled up to the house about seven or eight
And I yelled to the cabbie, "Yo holmes, smell ya later"
I looked at my kingdom
I was finally there
To sit on my throne as the prince of Bel-Air'

Collapse
 
moshikoi profile image
MoshiKoi

Quick question, but how long should the addition be? It says "picks the next line of code" so I assume not too long?

Collapse
 
thormeier profile image
Pascal Thormeier • Edited on

Ideally, a single line of code. Currently, I'm taking whichever snippet has the most upvotes, so it doesn't really matter. Just don't post entire frameworks :P

New programmer and javascript

Stop by this week's meme thread!