12 ms·
FizzBuzz in ten languages
- bradbeattie 8y agohttps://rosettacode.org/wiki/FizzBuzz https://rosettacode.org/wiki/FizzBuzz
- KineticLensman 8y agoIf you like this may I also recommend [0] which has fizzbuzz in: Java, VBA, php, cobol, forth, C++, brainfuck, python, Groovu, BASIC, JavaScript, CoffeeScript, sh, PowerShell, Clojure, Ruby, C#, Haskell, ABAP, Lua, Matlab, Common Lisp, Oracle PL/SQL, Scala, F#, Bash, C, LOLCODE, golang, Enterprise Java, MySQL, Visual FoxPro, Perl, shakespeare Of course, if you want it in Malboge [1], you can refer to a prior HN discussion [2] of FizzBuzz in multiple languages. [0] http://wiki.c2.com/?FizzBuzzTest http://wiki.c2.com/?FizzBuzzTest [1] https://en.wikipedia.org/wiki/Malbolge https://en.wikipedia.org/wiki/Malbolge [2] https://news.ycombinator.com/item?id=4921651 https://news.ycombinator.com/item?id=4921651
- happimess 8y agoThe "Haskell implementation using monoids" on this page is the only solution I've seen where adding a new behavior (e.g. "FizzBuzzWoof") only requires a modification in one spot. (d 3 "Fizz" <> d 5 "Buzz") becomes (d 3 "Fizz" <> d 5 "Buzz" <> d 13 "Woof") eta: And just below it is a similar solution in Python. Cool!
- duckerude 8y agoWith similar properties, but more disgusting: for n in range(1, 101): print(n, end='\r') if n % 3 == 0: print("Fizz", end='') if n % 5 == 0: print("Buzz", end='') print()
- drfuchs 8y agoExtra points for deviousness, but this won't produce the correct visual result when logged in on a hardcopy terminal (e.g. DECwriter); or even on a glass tty (e.g. DEC VT100) if you set the upper limit to 10001. It will also always fail a correctness test of diffing against the proper output. You should definitely consider entering the Obfuscated C contest, though.
- dbrgn 8y agoCrossposting my comment from the blog: The Rust example looks a bit strange, since you're matching on a variable, but don't actually use it. Instead, you could write the match like this: let div_by_three = x % 3 == 0; let div_by_five = x % 5 == 0; match (div_by_three, div_by_five) { (true, true) => println!("FizzBuzz"), (true, false) => println!("Fizz"), (false, true) => println!("Buzz"), _ => println!("{}", x), } ...or even like this: match (x % 3, x % 5) { (0, 0) => println!("FizzBuzz"), (0, _) => println!("Fizz"), (_, 0) => println!("Buzz"), _ => println!("{}", x), } Furthermore, inclusive ranges can be written like this: for x in 1..=100 {
- thanatos_dem 8y agoUnless I’m missing something, your second example seems to be the one in the article. Did the author change it? Edit: just saw the comments on the article. Yes, she did.
- malloryerik 8y agoThat looks so much like Elixir. for x <- 1..100 do case [rem(x, 3), rem(x, 5)] do [0, 0] -> IO.puts("FizzBuzz") [0, _] -> IO.puts("Fizz") [_, 0] -> IO.puts("Buzz") _ -> x end end
- CleanShirt 8y agoAny language that has pattern matching looks similar. Much nicer than if/else/switch.
- frutiger 8y agoIndeed both of those look so much like ML which predates them by a few decades.
- empath75 8y agoFizzbuzz using the scala type system https://gist.github.com/stew/4074742 https://gist.github.com/stew/4074742
- azinman2 8y agoPersonally I prefer a fizz buzz that doesn’t make them variables. The loop is so small and it’s obviously never “hot” enough code to make it worthwhile to pull the variables out. It looks like over-optimization to me.
- pedrokost 8y agoI agree, but for different reasons. I have seen a lot of code start with variables like `divisible_by_three`, only to have the requirements change to check division by 4, but programmers being too lazy to update the variable name as well.
- dacracot 8y agoThe next question I like to ask in an interview, once they have fizzbuzz working is, "Now make it more efficient."
- deleted 8y ago[deleted]
- edflsafoiewq 8y agoecho '#include <stdio.h>' > fb.c ./fizzbuzz > buf xxd -i buf >> fb.c echo 'int main(void) { return fwrite(buf, buf_len, 1, stdout) != 1; }' >> fb.c
- AndyKelley 8y agoZig: const std = @import("std"); pub fn main() u8 { @setEvalBranchQuota(2000); const precomputed_output = comptime fizzbuzz: { var s: []const u8 = ""; var i: usize = 1; while (i <= 100) : (i += 1) { if (i % 3 == 0 and i % 5 == 0) { s = s ++ "FizzBuzz\n"; } else if (i % 3 == 0) { s = s ++ "Fizz\n"; } else if (i % 5 == 0) { s = s ++ "Buzz\n"; } else { var buf: [20]u8 = undefined; const n = buf[0..std.fmt.formatIntBuf(&buf, i, 10, false, 0)]; s = s ++ n ++ "\n"; } } break :fizzbuzz s; }; const stdout = std.io.getStdOut() catch return 1; stdout.write(precomputed_output) catch return 1; return 0; } Output: $ zig build-exe fizzbuzz.zig $ ./fizzbuzz <correct output> $ strace ./fizzbuzz execve("./fizzbuzz", ["./fizzbuzz"], 0x7ffeeb1a4540 /* 132 vars */) = 0 write(1, "1\n2\nFizz\n4\nBuzz\nFizz\n7\n8\nFizz\nBu"..., 4131 exit(0) = ? The entire program is 1 write syscall that outputs the answer. I don't think it's theoretically possible to get faster than that.
- loeg 8y ago> The entire program is 1 write syscall that outputs the answer. I don't think it's theoretically possible to get faster than that. If stdout happens to be a socket, setsockopt + SO_SNDBUF might help runtime. But that is an extremely byzantine scenario. Another consideration might be a fast CPU attached to a fast but tiny icache and dcache with very slow memory, where reading the pregenerated string is slower than computing it.
- wolfi1 8y agoFizzBuzz Enterprise: https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpris...
- hashbig 8y agoHow have I not seen this before. It made my day.
- userbinator 8y agoGiven how similar the two languages are, both in syntax and culture, it's no surprise there's a C# version too: https://github.com/jongeorge1/FizzBuzzEnterpriseEdition-CSharp https://github.com/jongeorge1/FizzBuzzEnterpriseEdition-CSha...
- geraldbauer 8y agoFYI: I compiled a free (online) anthology / book about FizzBuzz titled "FizzBuzz (1, 2, Fizz, 4, Buzz,...) by Example - There's More Than One Way To Do It" [1]. Note, all examples are in ruby. Enjoy. Happy new year. Cheers. Prost. [1]: https://yukimotopress.github.io/fizzbuzz https://yukimotopress.github.io/fizzbuzz
- Tarean 8y agoTook this as an excuse to write it in pure lambda calculus https://gist.github.com/Tarmean/65da65b8da37bd66d48e96d2aa73662b https://gist.github.com/Tarmean/65da65b8da37bd66d48e96d2aa73... I always enjoy how lambda calculus suddenly becomes a readable language after the prelude: let (\n. let (\m. isZero (mod n m)) \divisibleBy. if (and (divisibleBy 3) (divisibleBy 5)) then FizzBuzz else (if (divisibleBy 3) then Fizz else (if (divisibleBy 5) then Buzz else (intToStr n)))) \fizzBuzzStep. (loop \recurse. \n. if (equals n 100) then nil else (cons (fizzBuzzStep n) (recurse (n+1))) ) 1) (\letArg letBody. letBody letArg) let, if, then, else, loop, and even the numbers are all functions.
- crispyambulance 8y agoThe whole point of fizzbuzz is to filter for people that can just solve a tiny problem in a reasonably short time-- that's it. Most interviewers will even give some slack if the person has to look up the modulo operator or even do with out it. If someone can't do it at all there's some kind of serious issue with the way they're approaching the problem, or perhaps they're just not capable of doing it. But another common way for people to fail or at least get red-flagged is to over-think it and come up with a turgid solution-- like using lambda calculus! Simple problem. Simple solution. Nothing fancy. Going against that is asking for failure.
- wz1000 8y agoLambda calculus isn't a "solution" to fizz buzz, it's just another language you can implement fizz buzz in, which is what the parent poster was likely intending to demonstrate.
- tonyedgecombe 8y agoIt's just a bit of fun, nobody is suggesting you do this in an interview.
- austincheney 8y agoThe lambda calculus approach provides an answer that is a theoretical solution for multiple programming languages. With very minor changes the same answer can apply to C Lang or JavaScript.
- chrisulloa 8y agoClojure version (defn fizzbuzz [x] (cond-> nil (zero? (mod x 3)) (str "Fizz") (zero? (mod x 5)) (str "Buzz") :always (or (str x)))) (doseq [x (range 1 101)] (prn (fizzbuzz x)))
- andrewstellman 8y agoI've been looking for an example that shows how pattern matching can make code much both compact and readable. I think this does nicely. Here's an example in Scala: (1 to 100).map(i => (i % 3, i % 5) match { case (0, 0) => "FizzBuzz" case (0, _) => "Fizz" case (_, 0) => "Buzz" case _ => s"$i" }).foreach(println) Compare that to the rest of the examples on the page. The only one that comes close in either readability or compactness (in my opinion) is the Rust example, mainly because it's syntactically almost identical, just a bit more verbose. I'm really excited that C# 8 will support similar syntax with _ discards.
- chucky 8y agoThe Haskell example is quite similar to the Scala/Rust example as well. I guess you could rewrite the Haskell version to match your Scala version pretty closely as well if you prefer doing the tuple construction and then matching on the tuple, like in your Scala version, instead of doing it directly inside the pattern match. Something like this, with the caveat that I haven't done any proper coding in Haskell in years and I don't have an interpreter installed to verify correctness. fb :: (Integer, Integer) -> String fb (mod3, mod5) | (0, 0) = "FizzBuzz" | (0, _) = "Fizz" | (_, 0) = "Buzz" | otherwise = show n main = putStrLn $ unlines $ map fb $ map (\x -> (x % 3, x % 5)) [1..100]
- steveklabnik 8y agoYou can do it like that in rust too, so I assume it works in Haskell.
- johnday 8y agoNot exactly write - you would use have to use either view patterns or a case...of statement rather than guards here. But the general gist is right.
- ngcazz 8y agoThe step in the composition chain breaking down the integers into ordered pairs of the remainders is classy. Well done. For added points we now need an ADT to represent the different possible results of the computation :)
- deleted 8y ago[deleted]
- _old_dude_ 8y agoJava version using higher order functions :) public interface Matcher { Optional<String> match(int value); static Matcher divideBy(int div, String text) { return value -> Optional.of(value).filter(v -> v % div == 0).map(__ -> text); } default Matcher zip(Matcher matcher, BinaryOperator<String> op) { return value -> Stream.of(match(value), matcher.match(value)).flatMap(Optional::stream).reduce(op); } public static void main(String[] args) { var matcher = divideBy(3, "Fizz").zip(divideBy(5, "Buzz"), String::concat); IntStream.rangeClosed(0, 100) .mapToObj(value -> matcher.match(value).orElse("" + value)) .skip(1).forEach(System.out::println); } }
- deleted 8y ago[deleted]
- deleted 8y ago[deleted]
- Spivak 8y agoYour bash example could be a little cleaner. Since 0 is truthy in bash and [ `expr something` ] is, for most purposes, (( )). for i in {1..100}; do if (( $i % 3 && $i % 5 )); then echo FizzBuzz elif (( $i % 3 )); then echo Fizz elif (( $i % 5 )); then echo Buzz else echo $i fi done Bash also has a decently powerful matching statement so you can do something similar to the rust example. for i in {1..100}; do case "$(( $i % 3 ))$(( $i % 5 ))" in 00) echo FizzBuzz ;; 0*) echo Fizz ;; *0) echo Buzz ;; *) echo $i ;; esac done
- esoterae 8y agoicydk, $ is redundant on alpha variable names within $(( ... ) HNY! (:
- tyingq 8y ago#/bin/bash for n in {1..100} ; do f="" ((n % 3)) || f="Fizz" ((n % 5)) || f="${f}Buzz" echo ${f:-$n} done
- gshubert17 8y agoBash exit code 0 is truthy, but that's not how the if statement works: if ((0)); then echo 0=true; else echo 0=false; fi if ((1)); then echo 1=true; else echo 1=false; fi # output 0=false 1=true To work as expected, the if statements should be rewritten as if ((i % 3 == 0 && i % 5 == 0)); then echo FizzBuzz and so on.
- vertline3 8y agoWhy or how did fizzbuzz earn its place in lore? I looked at Wikipedia and it didn't seem to go into detail. Also we have the teapot, hello world, Foo Bar What are some others?
- dabent 8y agoIt was popularized by Jeff Atwood in his blog entry "Why Can't Programmers.. Program?" https://blog.codinghorror.com/why-cant-programmers-program/ https://blog.codinghorror.com/why-cant-programmers-program/ Atwood referenced Imran Ghory who seems to have originated the test.
- vertline3 8y agoThis is neat, I didn't know it started there.
- stcredzero 8y agoWhy or how did fizzbuzz earn its place in lore? The functional why was as a filter for eliminating impostors. At the time it was new, no one could look up the answers for it, because it was such an arbitrary problem. Now, it's just a curiosity.
- henrikschroder 8y agoI wonder how widespread it's become in shitty prepare-for-coding-interview materials, so variations might be needed, but as a tool for identifying non-programmers, it is extremely good. It's ridiculous how good it is, it really shouldn't be, because as a decent programmer, it's so hard to understand how anyone could apply for a programming job, yet still be so bad at programming that they can't pass the test. And yet, there are so many people like that it's fucking scary.
- tyingq 8y agoPrinting the lyrics to "99 bottles of beer".
- RobertKerans 8y ago
- stcredzero 8y agoSomeone should make a tabletop game inspired by FizzBuzz. Or maybe a card game. It should have "bins" as a mechanic. Maybe change the name to include "bin" in it. Throw in 60's science fiction TV aesthetics and 30's gangsters.
- chapium 8y agoThe best i can come up with is a Rummy variant. If you need 30s gangsters to play Rummy: The Factor Baron then I have a kickstarter for you...
- stcredzero 8y agoI'm making a reference.
- tyingq 8y agoMade one that runs in both Golang and Perl: https://play.golang.org/p/ZSUME3zTZFt https://play.golang.org/p/ZSUME3zTZFt
- rafkin98 8y agoI like Ruby one liner from https://commandercoriander.net/blog/2013/02/03/fizzbuzz-in-one-line/ https://commandercoriander.net/blog/2013/02/03/fizzbuzz-in-o... puts (1..100).map { |i| (fb = [["Fizz"][i % 3], ["Buzz"][i % 5]].compact.join).empty? ? i : fb }
- deleted 8y ago[deleted]
- okl 8y agoAn Ada version using predicates: with Ada.Text_IO; procedure FizzBuzz_Predicate is subtype Div_3 is Integer with Dynamic_Predicate => Div_3 mod 3 = 0; subtype Div_5 is Integer with Dynamic_Predicate => Div_5 mod 5 = 0; begin for i in Integer range 1 .. 99 loop if i in Div_3 and i in Div_5 then Ada.Text_IO.Put_Line ("FizzBuzz"); elsif i in Div_3 then Ada.Text_IO.Put_Line ("Fizz"); elsif i in Div_5 then Ada.Text_IO.Put_Line ("Buzz"); else Ada.Text_IO.Put_Line (Integer'Image (i)); end if; end loop; end FizzBuzz_Predicate;
- levi_n 8y agoA bit shorter python version: for x in range(1, 101): out = "" if x % 3 == 0: out += "Fizz" if x % 5 == 0: out += "Buzz" print(out or x)
- a3n 8y agoprint('\n'.join([ 'fizzbuzz' if x%15 == 0 else 'fizz' if x%3 == 0 else 'buzz' if x%5 == 0 else str(x) for x in range(1, 101)])) Or for x in ['fizzbuzz' if x%15 == 0 else 'fizz' if x%3 == 0 else 'buzz' if x%5 == 0 else x for x in range(1, 101)]: print x
- bash-j 8y agoPython one liner: print('\n'.join([{(True, False): 'Fizz', (False, True): 'Buzz', (True, True): 'FizzBuzz'}.get((i % 3 == 0, i % 5 == 0), str(i)) for i in range(1, 101)]))
- deleted 8y ago[deleted]
- deleted 8y ago[deleted]
- Isaiah____ 8y agoIn R, using the tidyverse: x <- 1:100 case_when( x %% 35 == 0 ~ "fizz buzz", x %% 5 == 0 ~ "fizz", x %% 7 == 0 ~ "buzz", TRUE ~ as.character(x) )
- deleted 8y ago[deleted]
- bhrgunatha 8y agoMy favourite Fizzbuzz articles 50 Fizzbuzzes [1] and Fizzbuzz in Tensorflow [2]. [1] http://vihart.com/fifty-fizzbuzzes/ http://vihart.com/fifty-fizzbuzzes/ [2] http://joelgrus.com/2016/05/23/fizz-buzz-in-tensorflow/ http://joelgrus.com/2016/05/23/fizz-buzz-in-tensorflow/
- crimsonalucard 8y agoLOLCODE is hilariously readable.
- benatkin 8y agoThe python indentation is inconsistent - two spaces at the first level of indentation, and six spaces at the second level of indentation. I didn't think python would allow this, but apparently it does!
- dr_zoidberg 8y agoAs long as you don't try to change the indentation level within a block, it's allowed. It is, however, a style frowned upon -- you should be consistent and use always the same ammount of indentation for blocks. There are a few styles regarding multiline statements though.
- foxes 8y agoFor something a bit different calculate the gcd (although doing Euclid's algorithm is more expensive?). https://haskell.godbolt.org/z/m7IY8U https://haskell.godbolt.org/z/m7IY8U.
- KeyboardFire 8y agoLots more fizzbuzzes here, in both standard and weird languages: https://codegolf.stackexchange.com/q/58615/3808 https://codegolf.stackexchange.com/q/58615/3808 (They're golfed, meaning bytecount is minimized.)
- Narew 8y agoFor short solution (code golf), there is this challenge in PPCG : https://codegolf.stackexchange.com/questions/58615/1-2-fizz-4-buzz https://codegolf.stackexchange.com/questions/58615/1-2-fizz-...
- thisacctforreal 8y agoThis brainfuck implementation is super neat: https://codegolf.stackexchange.com/a/148958 https://codegolf.stackexchange.com/a/148958
- geraldbauer 8y agoFast. Faster. Fastest. The FizzBuzz Gold Standard. Lookup pre-calculated ("hard coded") constants. Don't over-engineer :-): def fizzbuzz [1, 2, "Fizz", 4, "Buzz", "Fizz", 7, 8, "Fizz", "Buzz", 11, "Fizz", 13, 14, "FizzBuzz", 16, 17, "Fizz", 19, "Buzz", "Fizz", 22, 23, "Fizz", "Buzz", 26, "Fizz", 28, 29, "FizzBuzz", 31, 32, "Fizz", 34, "Buzz", "Fizz", 37, 38, "Fizz", "Buzz", 41, "Fizz", 43, 44, "FizzBuzz", 46, 47, "Fizz", 49, "Buzz", "Fizz", 52, 53, "Fizz", "Buzz", 56, "Fizz", 58, 59, "FizzBuzz", 61, 62, "Fizz", 64, "Buzz", "Fizz", 67, 68, "Fizz", "Buzz", 71, "Fizz", 73, 74, "FizzBuzz", 76, 77, "Fizz", 79, "Buzz", "Fizz", 82, 83, "Fizz", "Buzz", 86, "Fizz", 88, 89, "FizzBuzz", 91, 92, "Fizz", 94, "Buzz", "Fizz", 97, 98, "Fizz", "Buzz"] end Source: https://yukimotopress.github.io/fizzbuzz#gold-standard https://yukimotopress.github.io/fizzbuzz#gold-standard
- a3n 8y agoPlus a program to produce the pre-calculated data, to avoid typos. :-)
- ben-schaaf 8y agoWhy not both at the same time. All you need is a language with compile-time execution: auto fizzbuzz(size_t n) { return iota(n) .map!((i) { if ((i % 15) == 0) { return "FizzBuzz"; } else if ((i % 3) == 0) { return "Fizz"; } else if ((i % 5) == 0) { return "Buzz"; } else { return i.to!string; } }); } void main() { // enum here forces compile-time execution enum fizzbuzz100 = fizzbuzz(100).join("\n"); writeln(fizzbuzz100); }
- a3n 8y agoOr: $ date +%A Tuesday $ anyfizzbuzzprogram > fizzbuzz100 $ cat fizzbuzz100 [output] $ date +%A Wednesday $ cat fizzbuzz100 [output] :-)
- romwell 8y ago
- YeGoblynQueenne 8y agoThe Prolog version is fine, but the nested conditionals make it harder to read and may cause confusion about scope (for example, it's not necessary to enclose "divBy3(X),divBy5(X)" in parentheses, as on line 6 in the article). Here's an alternative version, that avoids nested conditionals and also doesn't use the cut ("!") to control backtracking: fizzbuzz(X,'Fizz'):- 0 is mod(X,3). fizzbuzz(X,'Buzz'):- 0 is mod(X,5). fizzbuzz(X,X):- \+ fizzbuzz(X,'Fizz') ,\+ fizzbuzz(X,'Buzz'). print_fizzbuzz(N,M):- N > M. print_fizzbuzz(N,M):- N =< M ,forall(fizzbuzz(N,FBN) ,write(FBN) ) ,nl ,succ(N,N_) ,print_fizzbuzz(N_,M). This one uses Prolog's nondeterminsm to generate either Fizz, Buzz, both, or neither as apropriate and collects them all with forall/2 (yes, Prolog does have for-loops; of a sort), then adds a newline to the output. Call it like this: ?- print_fizzbuzz(1,100). And have a Happy New Year.
- YeGoblynQueenne 8y agoHow about machine-learning the Prolog version, using Inductive Logic Programming and Metagol [1]? Here's one way to do it: % e.g. place in metagol/examples/ :-['../metagol']. % Second-order inductive bias. metarule([P,Q],([P,A,A]:-[[Q,A]])). metarule([P,Q,B,C],([P,A,B]:-[[Q,A,C]])). % Learning primitives. prim(positive_integer/1). prim(exact_division/2). % Primitives' definitions. positive_integer(N):- between(1,inf,N). exact_division(X,Y):- positive_integer(X) ,divisor(Y) ,0 is X mod Y. divisor(3). divisor(5). divisor(15). % Training setup. learn_fizzbuzz:- % Positive examples Pos = [fizzbuzz(1,1) ,fizzbuzz(2,2) ,fizzbuzz(3,fizz) ,fizzbuzz(5,buzz) ,fizzbuzz(15,fizzbuzz) ] % Negative examples ,Neg = [fizzbuzz(1,fizz) ,fizzbuzz(1,buzz) ,fizzbuzz(3,fizzbuzz) ,fizzbuzz(5,fizzbuzz) ] % Train with metagol ,learn(Pos,Neg). We can put that in a file, consult it and call learn_fizzbuzz at the Prolog repl: ?- learn_fizzbuzz. % learning fizzbuzz/2 % clauses: 1 % clauses: 2 % clauses: 3 % clauses: 4 fizzbuzz(A,fizzbuzz):-exact_division(A,15). fizzbuzz(A,buzz):-exact_division(A,5). fizzbuzz(A,fizz):-exact_division(A,3). fizzbuzz(A,A):-positive_integer(A). true . This will give us the fizzbuzz/2 function, mapping each integer N to {fizz,buzz,fizzbuzz,N}. Then we can simply loop over it: print_fizzbuzz(N):- forall(between(1,N,I) ,(fizzbuzz(I,FBN) ,writeln(FBN) ) ). Note we learned a general version of fizzbuzz from only 5 positive and 4 negative examples. Just don't tell Joel Grus [2]. _______ [1] https://github.com/metagol/metagol https://github.com/metagol/metagol [2] http://joelgrus.com/2016/05/23/fizz-buzz-in-tensorflow/ http://joelgrus.com/2016/05/23/fizz-buzz-in-tensorflow/
- a3n 8y agoI love a good fizzbuzz HN thread, on a snowy day off with coffee, almost as much as a good vim HN thread.
- deleted 8y ago[deleted]
- TedDallas 8y ago--A T-SQL version Select Case When SomeNumber % 3 = 0 and SomeNumber % 5 = 0 Then 'FizzBuzz' When SomeNumber % 3 = 0 Then 'Fizz' When SomeNumber % 5 = 0 Then 'Buzz' Else Convert(VarChar(10), SomeNumber) End As Answer From ( Select Top 100 SomeNumber = Row_Number() Over (Order By [object_id]) From sys.all_objects ) as Answers
- leereeves 8y agoAs seen on reddit recently, Rockstar: Midnight takes your heart and your soul While your heart is as high as your soul Put your heart without your soul into your heart Give back your heart Desire is a lovestruck ladykiller My world is nothing Fire is ice Hate is water Until my world is Desire, Build my world up If Midnight taking my world, Fire is nothing and Midnight taking my world, Hate is nothing Shout "FizzBuzz!" Take it to the top If Midnight taking my world, Fire is nothing Shout "Fizz!" Take it to the top If Midnight taking my world, Hate is nothing Say "Buzz!" Take it to the top Whisper my world (Yes, that's actually source code.) https://github.com/dylanbeattie/rockstar https://github.com/dylanbeattie/rockstar
- earenndil 8y agoMinor correction: brainfuck implementations generally provide 30,000 one-byte cells, but opinions differ; some provide more, or provide an unlimited tape. See https://esolangs.org/wiki/Brainfuck#Memory_and_wrapping https://esolangs.org/wiki/Brainfuck#Memory_and_wrapping for more.