私は Lua スクリプト (セル オートメーション) に取り組んでおり、セルラー空間を 4 つの部分に分割する必要があります。各部分には独自の機能があります。次のコードを使用します (一部の人にはばかげているように見えるかもしれません)。
if cells:getCell(Coord{x < 25 ,y < 25}) then
cell.P = (cell.past.P + e*i1 + u1*i2)
elseif cells:getCell(Coord{x < 25 ,y > 25})then
cell.P = (cell.past.P + e*i1 + u2*i2)
elseif cells:getCell(Coord{x > 25 ,y < 25})then
cell.P = (cell.past.P + e*i1 + u3*i2)
else
cell.P = (cell.past.P + e*i1 + u4*i2)
end
上記のコードを書き直す正しい方法は何ですか?機能はありますか?ありがとうございました!