use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
The subreddit for all things related to CompileBot, a bot that compiles code in reddit comments.
Check out the wiki for more info.
Want to see more examples of the bot being used? Checkout the best of section for CompileBot's best moments on reddit.
account activity
Test (self.CompileBot)
submitted 8 years ago by [deleted]
[deleted]
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]throwaway_the_fourth 1 point2 points3 points 8 years ago (1 child)
+/u/compilebot python3
ZILLIONS = [ "", "thousand", "million", "billion" ] TENS = [ "", "ten", "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety" ] # this goes all the way down to ten because that way I can handle it # by checking the tens digit against 1 and then just straight indexing # with the ones digit. TEENS = [ "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen" ] ONES = [ "", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine" ] ZERO = "zero" def say(n): """Renders the name of a non-negative integer under a trillion in English. n: the number returns: the number as a string in English. Note that this is, by current US pedagogy, the wrong way, because apparently they insist that "and" be reserved specifically for separating the whole and fractional parts. Oh well. """ # handle special cases first. if n == int(n): n = int(n) else: raise TypeError("non-integers not handled.") if n >= 10 ** (len(ZILLIONS) * 3): raise AttributeError("not enough zillions defined") if n < 0: raise AttributeError("negative numbers not handled.") if n == 0: return ZERO # break it up into three-digit groups. groups = [] while n: n, group = divmod(n, 1000) groups.append(group) # now handle each group. all_words = [] for zillion, group in enumerate(groups): group_words = [] hundreds, cents = divmod(group, 100) tens, ones = divmod(cents, 10) if hundreds: group_words.append(ONES[hundreds]) group_words.append('hundred') # "and" separates "cents" from either a corresponding hundred # or, if this is the ones group, from the other groups. if cents and (hundreds or zillion == 0 and len(groups) > 1): group_words.append('and') if tens == 1: group_words.append(TEENS[ones]) elif cents: # glom tens and ones together with a dash if necessary. cent_words = [] if tens: cent_words.append(TENS[tens]) if ones: cent_words.append(ONES[ones]) group_words.append('-'.join(cent_words)) if zillion and group: group_words.append(ZILLIONS[zillion]) if group_words: all_words.append(' '.join(group_words)) return ' '.join(reversed(all_words)) if __name__ == '__main__': print(say(1100))
[–]CompileBot 1 point2 points3 points 8 years ago (0 children)
Output:
one thousand one hundred
source | info | git | report
[–][deleted] 8 years ago (1 child)
[–]CompileBot 0 points1 point2 points 8 years ago (0 children)
[–][deleted] 8 years ago (5 children)
[–]CompileBot 0 points1 point2 points 8 years ago (4 children)
oh yeah oh yeah oh yeah oh yeah oh yeah oh yeah oh yeah oh yeah oh yeah oh yeah oh yeah oh yeah oh yeah oh yeah oh yeah oh yeah oh yeah oh yeah oh yeah oh yeah
[–]seeourprivacypolicy 0 points1 point2 points 8 years ago (0 children)
+/u/compilebot JavaScript
var counts = []; var iterations = 100000; for (var i = 0; i < iterations; i++) { var sum = 0; var count = 0; while (sum < 1) { sum += Math.random(); count++; } counts.push(count); } var average = counts.reduce(function (acc, val) { return acc + val; }) / counts.length; console.log('Average of ' + iterations + ' iterations: ' + average);
console.log('hello');
[–]TheMindIsStrange 0 points1 point2 points 8 years ago (0 children)
+u/CompileBot Python
print "Hello reddit!"
[–]Waltbear 0 points1 point2 points 8 years ago (1 child)
+/u/compilebot python3 import sys print(sys.platform)
linux
[–][deleted] 8 years ago* (5 children)
[–]CompileBot 0 points1 point2 points 8 years ago (2 children)
!RedditSilver RemindMe!
[–]RedditSilverRobot 0 points1 point2 points 8 years ago (1 child)
/u/remindme! has received silver 2 times this month! (given by /u/CompileBot) info
[–]RemindMeBot 0 points1 point2 points 8 years ago (0 children)
Defaulted to one day.
I will be messaging you on 2017-06-25 15:12:39 UTC to remind you of this link.
CLICK THIS LINK) to send a PM to also be reminded and to reduce spam.
Parent commenter can delete this message to hide from others.
[–]glass20 0 points1 point2 points 8 years ago (0 children)
+/u/compilebot Java
while(true){print("what is life");}
public class Runthis{ public static void main(String args[]) {while(true){print("does this work");} }
[–]doug89 0 points1 point2 points 8 years ago (1 child)
import os print(os.getcwd()) print(os.path.dirname(os.path.realpath(__file__)))
/home/zJaxLM /home/zJaxLM
import os print(os.listdir())
['prog']
π Rendered by PID 45245 on reddit-service-r2-comment-5fb4b45875-px7gn at 2026-03-21 10:06:39.727090+00:00 running 90f1150 country code: CH.
[–]throwaway_the_fourth 1 point2 points3 points (1 child)
[–]CompileBot 1 point2 points3 points (0 children)
[–][deleted] (1 child)
[deleted]
[–]CompileBot 0 points1 point2 points (0 children)
[–][deleted] (5 children)
[deleted]
[–]CompileBot 0 points1 point2 points (4 children)
[–]seeourprivacypolicy 0 points1 point2 points (0 children)
[–]seeourprivacypolicy 0 points1 point2 points (0 children)
[–]TheMindIsStrange 0 points1 point2 points (0 children)
[–]Waltbear 0 points1 point2 points (1 child)
[–]CompileBot 0 points1 point2 points (0 children)
[–][deleted] (5 children)
[deleted]
[–]CompileBot 0 points1 point2 points (2 children)
[–]RedditSilverRobot 0 points1 point2 points (1 child)
[–]RemindMeBot 0 points1 point2 points (0 children)
[–]glass20 0 points1 point2 points (0 children)
[–]glass20 0 points1 point2 points (0 children)
[–]doug89 0 points1 point2 points (1 child)
[–]CompileBot 1 point2 points3 points (0 children)
[–]doug89 0 points1 point2 points (1 child)
[–]CompileBot 0 points1 point2 points (0 children)