Okay, I guess I might help by explaining what I did there.
- function paperArtist.calculateFieldScore(field,cb,cy)
+ function paperArtist.calculateFieldScore(field,cb,cx,cy)
Adding cx is required for adding "place the piece into the field" immediately below.
+ -- Place the piece into the field
This chunk of code places the piece (cb) into the field, so that score can be given on the field AFTER landing the piece, instead of BEFORE (like it does in current version).
- return 1e99
+ return 1e99,0,0
Inconsistent return type screws up code that calls this function (crash on perfect clear). This fixes it.
- local clear,rowB,colB=paperArtist.calculateFieldScore(field,shape,cy)
+ local clear,rowB,colB=paperArtist.calculateFieldScore(F,shape,cx,cy)
Added the cx parameter that I requested... and actually plz check if using F here is a bad idea. Do keep in mind that calculateFieldScore now actually modifies the board that it's fed into it.
Okay, I guess I might help by explaining what I did there.
Adding cx is required for adding "place the piece into the field" immediately below.
This chunk of code places the piece (
cb
) into the field, so that score can be given on the field AFTER landing the piece, instead of BEFORE (like it does in current version).Inconsistent return type screws up code that calls this function (crash on perfect clear). This fixes it.
Added the
cx
parameter that I requested... and actually plz check if using F here is a bad idea. Do keep in mind thatcalculateFieldScore
now actually modifies the board that it's fed into it.