| Home | Tutorials | Forums | Articles | Blogs | Movies | Library | Employment | Press | Buy templates |
|
|
#1 |
|
is my last name...
Join Date: May 2004
Posts: 964
|
Ok, for those of you who complained about the hundredth time someone challenged for the rotating cube...
Try this: Extend the String Class so that... A) The class has all of the methods of the String Class B) Adds only 1 other method which allows for the String to be split by muliple delimiters. Must return an array. (Much like the original split() but better ) C) Class must be 25 lines of code or less. Only {} Don't count. D) Must be your own work...obviously. E)...It must have a constructor. -added within 5mins of thread post- The class with the most capability and fewest lines wins. Abviously following the list above. I will post mine after we get a few going...I've already done it. Last edited by madgett; 04-04-2005 at 08:37 PM.. Reason: Constructor must be in the class |
|
|
|
|
|
#3 |
|
is my last name...
Join Date: May 2004
Posts: 964
|
The split() command current only accepts 1 delimiter set. "," or ",#" etc...but that's only 1, I am saying come up with a Class that extends String that allows for multiple delimiter sets at the same time instead of one. Know what I mean? So you would be able to use "," and ",#" if you so choose.
|
|
|
|
|
|
#4 |
|
six eyes
|
you mean something like this?
ActionScript Code:
__________________
(6) |
|
|
|
|
|
#5 |
|
is my last name...
Join Date: May 2004
Posts: 964
|
Looks very interesting senocular, now all you have to do is make it a ActionScript Class that extends the String Class and returns an array. Make sure you have A-E.
|
|
|
|
|
|
#7 |
|
is my last name...
Join Date: May 2004
Posts: 964
|
If you do:
ActionScript Code:
Code:
output: P A T S Y . Ideally you should get the same output even using the multiple delimiter technique which the challenge is proposing. |
|
|
|
|
|
#8 |
|
Off-Line
Join Date: Aug 2004
Location: Ibiza/Spain language :Hungarian/German/ abit English
Posts: 6,539
|
here one line
hope you not think i will make a class for ONE line ? ![]() PHP Code:
|
|
|
|
|
|
#9 |
|
is my last name...
Join Date: May 2004
Posts: 964
|
Well, anyone can prototype in few lines...but that's not the challenge, I want to see some classes. To get the fewest lines in a class is more challenging. You guys came up with some great stuff, but use a class. In the String.split() function there's a "limit" parameter, those prototypes don't include that.
Also, Xeef your prototype fails if you use º in the string. I'm sure a class couldn't be that much more difficult...I mean c'mon. My entire class with the contructor is 17 lines. Shoot for that. |
|
|
|
|
|
#10 | |
|
Off-Line
Join Date: Aug 2004
Location: Ibiza/Spain language :Hungarian/German/ abit English
Posts: 6,539
|
to do a class is no problem but for what ?
it's like make a chalenge to write a class which trace a variable to screen in such a case i write trace(var) and not make a class it's a bit like taking cement stones and a roof for go camping where by what woud by the advantage of a class in oposite to the prototypes you see above ? Quote:
|
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|