7 kyu

80's Kids #5: You Can't Do That on Television

461 of 1,489NateBrady23

Description:

There are just some things you can't do on television. In this case, you've just come back from having a "delicious" Barth burger and you're set to give an interview. The Barth burger has made you queezy, and you've forgotten some of the import rules of the "You Can't Do That on Television" set.

If you say any of the following words a large bucket of "water" will be dumped on you: "water", "wet", "wash" This is true for any form of those words, like "washing", "watered", etc.

If you say any of the following phrases you will be doused in "slime": "I don't know", "slime"

If you say both in one sentence, a combination of water and slime, "sludge", will be dumped on you.

Write a function, bucketOf(str), that takes a string and determines what will be dumped on your head. If you haven't said anything you shouldn't have, the bucket should be filled with "air". The words should be tested regardless of case.

Examples:

bucketOf("What is that, WATER?!?") -> "water"
bucketOf("I don't know if I'm doing this right.") -> "slime"
bucketOf("You won't get me!") -> "air"
bucketOf("What is that, WATER?!?") -> "water"
bucketOf("I don't know if I'm doing this right.") -> "slime"
bucketOf("You won't get me!") -> "air"
bucketOf("What is that, WATER?!?") -> "water"
bucketOf("I don't know if I'm doing this right.") -> "slime"
bucketOf("You won't get me!") -> "air"
bucket_of("What is that, WATER?!?") -> "water"
bucket_of("I don't know if I'm doing this right.") -> "slime"
bucket_of("You won't get me!") -> "air"
bucketOf("What is that, WATER?!?") -> "water"
bucketOf("I don't know if I'm doing this right.") -> "slime"
bucketOf("You won't get me!") -> "air"
Check out my other 80's Kids Katas:
Fundamentals
Algorithms
Strings
Regular Expressions

Stats:

CreatedDec 8, 2015
PublishedDec 8, 2015
Warriors Trained2790
Total Skips117
Total Code Submissions9338
Total Times Completed1489
JavaScript Completions461
Ruby Completions123
Python Completions521
CoffeeScript Completions14
Java Completions341
C++ Completions96
Total Stars43
% of votes with a positive feedback rating86% of 327
Total "Very Satisfied" Votes255
Total "Somewhat Satisfied" Votes55
Total "Not Satisfied" Votes17
Ad
Contributors
  • NateBrady23 Avatar
  • jhoffner Avatar
  • GiacomoSorbi Avatar
  • Insti Avatar
  • hilary Avatar
  • alessandrodalbello Avatar
  • kazk Avatar
  • clcraig Avatar
  • FArekkusu Avatar
  • cliffstamp Avatar
  • saudiGuy Avatar
Ad