Last edited by Old_Grey_Wolf; December 7th, 2010 at 05:18 AM.
Use whatever OS or desktop works for you. Dual boot or use VMs if you want. Backup your computer regularly, and definitely before upgrading, partitioning, or installing an OS.
No support requests by PM please.
This is my Python contribution. Hope you like itCode:#!/usr/bin/env python def main(): bugs = 1 while True: if bugs <= 1: print "One tiny little bug in the code\nOne tiny little bug." print "Fix one bug, run it again" bugs += 1 else: bugs += 1 print "%i little bugs in the code\n%i little bugs." % (bugs, bugs) print "Fix one bug, run it again" return 0 if __name__ == '__main__': main()
Thanks all, glad it touched a chord - to coin a phrase!
Dear god, I would like to file a bug report.
increase Firefox startup speed and speed of Smart Location Bar:
http://ubuntuforums.org/showthread.php?t=1088094
Ruby
Code:#!/usr/bin/env ruby def sing(cycles) iterations = cycles.nil? ? 100 : cycles.to_i count = bugs = 1 while count <= iterations puts "#{bugs} little bug#{"s" if bugs > 1} in the code,\n#{bugs} little bug#{"s" if bugs > 1}." puts "Fix one bug, and run it again...\n\n" count += 1 bugs += Random.new.rand(1..3) end puts "...and the cycle goes on and on...happy coding!" end sing(ARGV[0])
Last edited by trivialpackets; December 7th, 2010 at 04:12 PM.
TheWeakSleep, TheLions, and eric.proctor, I should try running each of those.
Use whatever OS or desktop works for you. Dual boot or use VMs if you want. Backup your computer regularly, and definitely before upgrading, partitioning, or installing an OS.
No support requests by PM please.
If you believe everything you read, you better not read. ~ Japanese Proverb
If you don't read the newspaper, you're uninformed. If you read the newspaper, you're mis-informed. - Mark Twain
Thinking about becoming an Ubuntu Member?
I'm working on learning python currently, so I fixed the "bug" and added a feature (random bug counts) to the code posted earlier.
Code:#!/usr/bin/env python #Filename: programmers_song.py import random def main(): bugs = 1 iterations = 0 print("One tiny little bug in the code\nOne tiny little bug.") print("Fix one bug, run it again") while True: bugs += random.randint(1,4) iterations += 1 print "%i little bugs in the code\n%i little bugs." % (bugs, bugs) print "Fix one bug, run it again" if iterations >= 100: return False if __name__ == '__main__': main()
Bookmarks