Tuesday, November 17, 2009

Starting 0.2 with reverse()

So far this reverse function is as easy as it sounds. Take an array and flip it around so that the first element becomes the last and vice versa. For the most part it’s done, but I get bothered by little things. For example on the processing page, reverse displays the array but with no comma (,) separator EX:

String sa[] = { "OH ", "NY ", "MA ", "CA "};
sa = reverse(sa);
print(sa);  // Prints "CA MA NY OH "

In my java script output it looks similar but with “,” that keep being put in  Ex:

The output should be: BMWVolvoSaab   :(

So far I’m trying to use a regExp to search for “,”  and replace with “” but I’m getting an error.

This post is also just to get into the habbit of blogging because I havn’t been doing it enough in this course and I don’t usually think this kind of stuff is a blog worthy post.

No comments:

Post a Comment