Skip to content

Commit

Permalink
Added reverse( array ).
Browse files Browse the repository at this point in the history
  • Loading branch information
F1LT3R committed Jan 23, 2010
1 parent 201e6c0 commit ca85bba
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 3 additions & 5 deletions example.pjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@



float a = PI;
float c = cos(a);
float ac = acos(c);
// Prints "3.1415927 : -1.0 : 3.1415927"
console.log(a + " : " + c + " : " + ac);
String sa[] = { "OH ", "NY ", "MA ", "CA "};
sa = reverse(sa);
console.log(sa); // Prints "CA MA NY OH "
4 changes: 4 additions & 0 deletions processing.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,8 @@
// Array handling
////////////////////////////////////////////////////////////////////////////



p.splitTokens = function( str, tokens ){

if( arguments.length == 1 ){
Expand Down Expand Up @@ -559,6 +561,8 @@

return array;
};

p.reverse = function( array ){ return array.reverse() };



Expand Down

0 comments on commit ca85bba

Please sign in to comment.