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 5

Welcome to day 5! I think we're passt the next "line" of code, so we'll use the most liked "piece" of code from here on. Not an issue, though. Congrats to @rafaelhashimoto for picking this large snippet. I had to adjust it a bit to fit the previous code.

his 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
def letsDoThis
  # 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

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

See you in 24 hours!

Top comments (2)

Collapse
 
manthanbhatt profile image
Manthan Bhatt
let profit = 0; //Millons of dollars
function init_take_over_twitter (new_owner) {
   if (new_owner == 'Elon Musk') {
      init_emp_audit();
  }
}

function fire_emp(type) {
   return 'bye bye ' + type;
}

function init_emp_audit () {
     fire_emp('CEO');
     profit += 10000;
     while (profit < 44000) {
         fire_emp('Software Engineers');
         profit += 1000;
      }
     // let that sink in
}
Enter fullscreen mode Exit fullscreen mode
Collapse
 
mhcrocky profile image
mhcrocky

great.