pygame is
Simple DirectMedia Layer is
Site Swing
The BUTT Project

The BUTT Project - 0.38

Chris Uzal (c4)




You can blame technomancer for this one. After my pyBCD binary clock project, he wrote "next make one that displays unix time in proper binary :P"

Here it is: The BUTT Project. (Ta-da!)

Now you can display UNIX time in binary with the Binary UNIX Time Terminal. Move your BUTT around the screen as you hopelessly try to come up with ways to interpret the binary sequence.

Seriously, this program is crazy. Easy to write but crazy nonetheless. The only way I know the output is correct is because the code is correct. If you ask me what the clock says... [/me shrugs]

Not sure what more I'll add. I have some ideas for finer color control than I had in the last project I'd also like to dynamically change the font size with the window. That has proven to be much more of a challenge with this project than pyBCD.


Home Page:


click to view original size


The BUTT Project - 0.38 - Jul 2, 2008 account Comments

If you wish to leave a comment with your account, please sign in first.

May 2, 2012 8:33pm - Chris Uzal - nickname: (c4)
Does anybody have this? I seem to have lost it in the sands of time. Contact me
July 14, 2008 7:25pm - Chris Uzal - nickname: (c4)
If you check the google with the title of this project, you'll see anti-smoking advocates will have exposure to the python language and the pygame library.

[Cue: evil laughter]
July 14, 2008 7:22pm - Chris Uzal - nickname: (c4)
Readability is a nontrivial matter if someone plans to use it. Of course, a potential user could simply learn to read the single line. Going the long way is self explanatory. No commenting is really required when Python isn't coded with the dark side mantra: "if it's hard to write, it should be hard to read." :)

I like the recursive function also.
July 14, 2008 1:07am - Jordan Trudgett - nickname: (tgfcoder)
Yeah, it is, isn't it?. But if I were to implement it, it would probably be in a little neato function.. but commentspace is precious :)
July 13, 2008 5:09pm - Marcel Rodrigues - nickname: (marcel)
Jordan Trudgett, this is a interesting way to convert to binary. You can just change it to:

"".join([['0','1'][x&(1<<y)>0] for y in range(int(math.log(x,2))+1)][::-1])

The problem is: "Readability counts."
I like the recursive style:

def bin(x):
if x < 2:
return str(x)
return bin(x / 2) + str(x % 2)
July 10, 2008 10:45pm - Jordan Trudgett - nickname: (tgfcoder)
I didn't actually change your code at all, but I thought since you had a convert_to_binary function, it might be useful to know that it can be done in one line like that (but will only work for strictly positive integers)

Whether or not it is an improvement is entirely up to you. Just some food for thought. :)
July 10, 2008 7:23pm - Chris Uzal - nickname: (c4)

send me your update to the source and I'll post a new release.

My handle @edgefcivilization dot commercial.

July 10, 2008 4:15am - Jordan Trudgett - nickname: (tgfcoder)
"".join([['0','1'][x&(1<<y)>0] for y in range(int(math.log(x)/math.log(2))+1)][::-1])

This also works for converting a decimal integer x to a binary string.
(written by me.)
If you want to know how it works, feel free to ask
July 3, 2008 2:54pm - Chris Uzal - nickname: (c4)
:) I didn't mind the request and the pygame world is a better place because of it. My convert_to_binary() function takes any number and returns a string binary representation. Any futuristic/science fiction game could incorporate it as a puzzle or decoration. I handle the surface stuff elsewhere.
July 3, 2008 2:31am - Paul Davey - nickname: (technomancer) - 5/5
i didnt really expect you to do it
July 2, 2008 9:50pm - Emanuel Berg - nickname: (metabaron)

our projects welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
recent releases
Feb 21, 2017

Jan 31, 2017

Jan 24, 2017

Jan 18, 2017

Jan 7, 2017

Dec 30, 2016

Dec 8, 2016

Nov 28, 2016

Nov 27, 2016

... more!
for pygame related questions, comments, and suggestions, please see help (lists, irc)