rubix :: RubixCube :: rotate_column
private fun rotate_column(col_id: Int, direction: Int) do
var col_data = rot_col_buffer
if col_data.is_empty then for i in [0 .. 4[ do col_data.add(new Array[Int])
array1d_copy_to(coldata(front_face, col_id), rot_col_buffer[0])
array1d_copy_to(coldata(top_face, col_id), rot_col_buffer[1])
array1d_copy_to(coldata(back_face, col_id), rot_col_buffer[2])
array1d_copy_to(coldata(bottom_face, col_id), rot_col_buffer[3])
if direction == clock then
rot_col_buffer.rotate_left
else if direction == counterclock then
rot_col_buffer.rotate_right
else
abort
end
set_coldata(front_face, col_id, rot_col_buffer[0])
set_coldata(top_face, col_id, rot_col_buffer[1])
set_coldata(back_face, col_id, rot_col_buffer[2])
set_coldata(bottom_face, col_id, rot_col_buffer[3])
end
lib/rubix/rubix.nit:277,2--295,4