Author |
Message |
ZeroPaladn
|
Posted: Tue Sep 20, 2005 1:05 pm Post subject: very basic decimal --> binary converter |
|
|
this is my basic decimal to binary converter. im working on a way to go backwards from binary to decimal. its not very user friendly, but hey, whatever. |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Mr. T
![](http://www.madpaintballer.com/images/purepwnage.gif)
|
Posted: Tue Sep 20, 2005 4:44 pm Post subject: Alex's Opinion |
|
|
Good effort. |
|
|
|
|
![](images/spacer.gif) |
ZeroPaladn
|
Posted: Wed Sep 21, 2005 7:08 am Post subject: (No subject) |
|
|
thanks. im going to post the other half of the program (binary --> decimal) later on either today or tomorow when i get to finishing it. |
|
|
|
|
![](images/spacer.gif) |
codemage
![](http://usera.imagecave.com/codemage/codemage-small.gif)
|
Posted: Thu Sep 22, 2005 1:07 pm Post subject: (No subject) |
|
|
If this is for school, you'd get brownie points for throwing in hex conversion as well.
binary -> hex -> binary is the easiest conversion of all 3.
Once you have that down, you can 'cheat' by converting
decimal -> binary -> hex
or
hex -> binary -> decimal
...for conversion between all three. |
|
|
|
|
![](images/spacer.gif) |
ZeroPaladn
|
Posted: Thu Sep 22, 2005 1:33 pm Post subject: (No subject) |
|
|
lolz, yeah but i prefer a challenge instead of going hex/bin. then again, nobody said bin/dec was hard...
Ill do it. |
|
|
|
|
![](images/spacer.gif) |
zylum
![](http://compsci.ca/v3/uploads/user_avatars/1689129126468091c334ee0.gif)
|
Posted: Thu Sep 22, 2005 5:49 pm Post subject: (No subject) |
|
|
behold... a function that has the ability to convert from any base to any other base in 1 line of code (minus the function declaration):
code: | fcn baseConverter (x : string, initialBase, resultBase : int) : string
result intstr ((strint (x, initialBase)), 0, resultBase)
end baseConverter |
![Laughing Laughing](http://compsci.ca/v3/images/smiles/icon_lol.gif) |
|
|
|
|
![](images/spacer.gif) |
ZeroPaladn
|
Posted: Fri Sep 23, 2005 8:57 am Post subject: (No subject) |
|
|
HOLY F***ING S***! sorry for caps but i was going to create a function for each thing (ex binary2hex, binary2decimal, you get the idea), but, wow. Thanks alot zylum
+bits |
|
|
|
|
![](images/spacer.gif) |
[Gandalf]
![](http://compsci.ca/v3/uploads/user_avatars/189297994e4c716fec7f1.png)
|
Posted: Fri Sep 23, 2005 3:05 pm Post subject: (No subject) |
|
|
Quote: +bits
It just so happens that he is a moderator, and +bits will do nothing, but it's the thought that counts .
I am pretty sure your teacher would be happier if you did the conversions using the method you learned, not (basically) a function that already exists to do it. Sure, "don't recreate something if there's an existing library function to do it for you", but there's also the learning process. |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
ZeroPaladn
|
Posted: Mon Sep 26, 2005 11:03 am Post subject: (No subject) |
|
|
lolz, attempting to do waht zylum suggested is harder than i though, so i stuck with the old idea that i had. Lolz, it wouldnt let me give him bits anyways... ![Embarassed Embarassed](http://compsci.ca/v3/images/smiles/icon_redface.gif) |
|
|
|
|
![](images/spacer.gif) |
Mr. T
![](http://www.madpaintballer.com/images/purepwnage.gif)
|
Posted: Tue Sep 27, 2005 8:12 pm Post subject: Alex's Opinion |
|
|
ZeroPaladn wrote: Lolz, it wouldnt let me give him bits anyways... ![Embarassed Embarassed](http://compsci.ca/v3/images/smiles/icon_redface.gif)
Mod bit totals are fixed. ![Rolling Eyes Rolling Eyes](images/smiles/icon_rolleyes.gif) |
|
|
|
|
![](images/spacer.gif) |
Cervantes
![](http://compsci.ca/v3/uploads/user_avatars/1023105758475ab2e040bde.jpg)
|
Posted: Tue Sep 27, 2005 9:37 pm Post subject: Re: Alex's Opinion |
|
|
Pwned wrote: ZeroPaladn wrote: Lolz, it wouldnt let me give him bits anyways... ![Embarassed Embarassed](http://compsci.ca/v3/images/smiles/icon_redface.gif)
Mod bit totals are fixed. ![Rolling Eyes Rolling Eyes](images/smiles/icon_rolleyes.gif)
By which he means the whole donation-modding-of-bits is bugged right now. You can still give bits to mods. The difference is our bits go back to 1000 the next time we post. |
|
|
|
|
![](images/spacer.gif) |
ZeroPaladn
|
Posted: Wed Sep 28, 2005 8:32 am Post subject: (No subject) |
|
|
lolz, you learn sumthing every day now dont we?
EDIT
I didnt know zylum was a mod, grats |
|
|
|
|
![](images/spacer.gif) |
beard0
![](http://ugray.be/compsci/silly.gif)
|
Posted: Wed Sep 28, 2005 4:37 pm Post subject: (No subject) |
|
|
ZeroPaladn wrote: I didnt know zylum was a mod, grats
If someone has 1000 bits exactly, chances are pretty darn good that that person is a mod. |
|
|
|
|
![](images/spacer.gif) |
wtd
|
Posted: Thu Sep 29, 2005 12:47 pm Post subject: (No subject) |
|
|
ZeroPaladn wrote: I didnt know zylum was a mod, grats
He's a stealth mod.
Not that I would know anything about that... |
|
|
|
|
![](images/spacer.gif) |
[Gandalf]
![](http://compsci.ca/v3/uploads/user_avatars/189297994e4c716fec7f1.png)
|
Posted: Thu Sep 29, 2005 2:45 pm Post subject: (No subject) |
|
|
Quote: zylum
Moderator
Kick Ass Hacker
Not very stealthy anymore, is he? ![Surprised Surprised](http://compsci.ca/v3/images/smiles/icon_surprised.gif) |
|
|
|
|
![](images/spacer.gif) |
|