From: Albert Ng Date: 2007-03-12T04:24:36+09:00 Subject: directly modify a part on an array for quiz #117 purposes ------=_Part_20930_16457504.1173641074117 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline From Ruby quiz #117 (much fun) #bad code by me, interesting bits shamelessly stolen from Dave Burt neighborhood=[@grid[x0][y0], @grid[x0][y1], @grid[x1][y0], @grid[x1][y1]] where each element of @grid[][] is a string, x1 = x0+1, and y1=y0+1 is there a way to do the following: @grid[x0][y0], @grid[x0][y1], @grid[x1][y0], @grid[x1][y1] = @grid[x1][y0], @grid[x0][y0], @grid[x1][y1], @grid[x0][y1] in a more readable way I thought *neighborhood = @grid[x1][y0], @grid[x0][y0], @grid[x1][y1], @grid[x0][y1] would be equivalent, but it isn't. ------=_Part_20930_16457504.1173641074117--