pygame is
Python
Simple DirectMedia Layer
 
 
pygame.org is
Site Swing
The BUTT Project

The BUTT Project - 0.38

Chris Uzal (c4)

Tags:

Description

:D

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.

Links

Home Page: http://www.edgeofcivilization.com/
Source: http://edgeofcivilization.com/py_code/pyBCD/BUTT_source.zip
Windows: http://edgeofcivilization.com/py_code/pyBCD/BUTT.zip

Screenshot


click to view original size

Releases

The BUTT Project - 0.38 - Jul 2, 2008

Pygame.org account Comments

If you wish to leave a comment with your pygame.org 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 @chrisuzal.com.
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)
tgfcoder,

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

My handle @edgefcivilization dot commercial.

Peace.--Chris
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)
Cool
spotlight

 
our projects
pygame.org welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
 
recent releases
Oct 1, 2014

Sep 19, 2014

Sep 17, 2014

Sep 9, 2014

Sep 8, 2014

Sep 7, 2014


Sep 5, 2014

Aug 26, 2014

Aug 21, 2014


Aug 18, 2014

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