PDA

View Full Version : Take on THIS Challange!


Hosma293
02-20-2005, 03:03 AM
Hi All

If you think of yourself as an ActionScript Guru then take on this challange.
The Challange is quite simple..
Make a Text2Binary and Binary2Text converter!
And that may sound easy but unless you know your ActionScript it is no easy task! :)
It does not have to be done completely in ActionScript because its extremely hard to get everything right and it must NOT use PHP! :p

If anyone takes on this challange post your converter here. The best one wins! :D

PS: You don't actually win anything, its just for fun.

CyanBlue
02-20-2005, 03:11 AM
Uh... What do you mean by 'Text2Binary and Binary2Text converter'??? Can you explain??? :)

Laguana
02-20-2005, 04:02 AM
I think he means turning the text into it's binary representation (like an A is actually represented by some number in ascii, which then has it's own representation in binary)

Xeef
02-20-2005, 03:19 PM
t = "Hope understand right";
function T2B(T) {
A = T.split("");
for (a in A) {
A[a] = ord(A[a]).toString(16);
}
return A.join("");
}
function B2T(T) {
A = "";
for (a=0; a<T.length; a += 2) {
A += chr((Number("0x"+T.substr(a, 2))));
}
return A;
}
trace(T2B(t));
trace(B2T("5468697320697320746f6f6f6f6f206561737920212121"));

Xeef
02-20-2005, 03:31 PM
PS.

T2B --> will fail on Characters which has a ASCii Nr below 15 (woud need to put a "0")

Hosma293
02-21-2005, 08:00 AM
Xeef, Could you make it use two text boxs and two buttons to do the conversions?
e.g.
_______________ _______________




_______________ _______________

|convert to binary| |convert to text|

Say if you clicked on 'Convert to Binary' then flash would read the text from the left textbox and the binary text would appear in the right box and vise versa for 'Convert to Text'

farafiro
02-21-2005, 08:24 AM
heheheeeeee
this was done by pixelwit so long ago
http://www.actionscript.org/forums/showthread.php3?t=21433&page=2&pp=15
see post #23

Hosma293
02-21-2005, 08:38 AM
Its supposed to be a competion, People aren't making this for me because I can make one myself :)

farafiro
02-21-2005, 09:11 AM
lol
sorry mate but IMO this can't be a competition for it needs no talent
only one or two ways to do it
so if somone did it b4, no need for new entries

Hosma293
02-21-2005, 09:20 AM
Good Point.. Bugga, I wanted to make a competion thats never been heard of! :D

CyanBlue
02-21-2005, 02:45 PM
I had my filthy code here as well... I just did not know what the question was... :D
http://www.actionscript.org/forums/showpost.php3?p=129759&postcount=13

Lost ?
02-22-2005, 10:24 AM
heheheeeeee
this was done by pixelwit so long ago
http://www.actionscript.org/forums/showthread.php3?t=21433&page=2&pp=15
see post #23


How do you manage to find all these things?? :confused:

farafiro
02-22-2005, 10:34 AM
by the magic button in this forums "SEARCH"
also, I am too old and I've seen the birth of most of theses posts

Lost ?
02-22-2005, 08:22 PM
Fair enough :D :D