def switch(a,x,y) a.insert(y+1,a[x]) a.delete_at(x) end def sortpos x=0 y=1 while x < @breadth.size - 1 while y < @breadth.size if @breadth[y-1] > @breadth[y] switch(@depth,y-1,y) switch(@breadth,y-1,y) switch(@perks,y-1,y) elsif @breadth[y-1] == @breadth[y] && @depth[y-1] > @depth[y] switch(@depth,y-1,y) switch(@breadth,y-1,y) switch(@perks,y-1,y) end p @breadth p @depth p @perks p x.to_s + ","+ y.to_s y = y + 1 end x = x + 1 y = 1 end end
1.jpg (47.44 KB, 下载次数: 18)
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |