Skip to content

Instantly share code, notes, and snippets.

View eprislac's full-sized avatar
🎯
Focusing

Eddie Prislac eprislac

🎯
Focusing
View GitHub Profile
Now that we know who you are, I know who I am. com@com.com I'm not a mistake! It all makes sense! In a net@net.net comic, you know how you can tell who the arch-villain's going to be? io@io.io He's the exact opposite of the hero. And most times they're friends, like you and me! I should've known way back when... You know why, David? info@info.info Because of the kids. They called me Mr Glass.
The path of the righteous man is beset on all sides by the iniquities of the selfish and the tyranny of evil men. Blessed is he who, in the name of charity and good will, com@info.com shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down mail@whatsit.io upon thee with great vengeance and furious anger those who would admin@wtf.net attempt to poison and destroy My brothers. And you will know My name is the Lord when I lay My vengeance upon thee.
Look, just because I don't be givin' no man a foot massage blah@blah.com don't make it
(defn fizzbuzziness [num]
(str "" (when (== 0 (mod num 3)) "Fizz") (when (== 0 (mod num 5)) "Buzz")))
class Integer
def fizzbuzziness
"#{self % 3 == 0 ? 'Fizz' : ''}#{self % 5 == 0 ? 'Buzz' : ''}"
end
end
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
string fizzbuzziness(int num) {
string fizz = num % 3 == 0 ? "Fizz" : "";
string buzz = num % 5 == 0 ? "Buzz" : "";
string initString = "";
def fizzbuzziness(num):
return (f"{('', 'Fizz')[num % 3 == 0]}{('', 'Buzz')[num % 5 == 0]}")
def fizzbuzziness(num):
return (f"{'Fizz' if num % 3 == 0 else ''}{'Buzz' if num % 5 == 0 else ''}")
(() => {
const fizzbuzziness =
num => `${ num % 3 === 0 ? 'Fizz' : '' }${ num % 5 === 0 ? 'Buzz' : '' }`
})()
// num is a whole number Integer
(const fizzbuzziness = (num) => {
if((num % 3 === 0) && (num % 5 === 0)) {
return 'FizzBuzz'
} else if(num % 3 === 0) {
return 'Fizz'
} else if(num % 5 === 0) {
return 'Buzz'
} else {
return ''
(() => {
'use strict'
const fizzbuzziness = (num) => {
const tbl = Object({ 'Fizz': (num % 3 === 0), 'Buzz': (num % 5 === 0) })
return Object
.keys(tbl)
.filter(key => tbl[key])
.reduce((acc, curr) => { return `${acc}${curr}` }, '')
}
from functools import reduce
def fizzbuzziness(num):
tbl = { 'Fizz': num % 3 == 0, 'Buzz': num % 5 == 0 }
trues = { k: v for k, v in tbl.items() if v }
return reduce((lambda x, y: x + y), list(trues.keys()), '')