You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
program tictactoe.aleo;
struct Row:
c1 as u8;
c2 as u8;
c3 as u8;
struct Board:
d1 as Row;
d2 as Row;
d3 as Row;
function make_move:
input r0 as u8.private;
input r1 as u8.private;
input r2 as u8.private;
input r3 as Board.private;
output r0 as u8.private;
The above program requires an input in this format:
You need to denote the register as d1, d2, and d3, but the Aleo WASM getFunctionInputs (e.g. aleoWASM.Program.fromString(value).getFunctionInputs()) does not give the register names when nested. This is the result of just the Board from getFunctionInputs but you can see if gives the child registers but not the d registers within the Board struct.
I would propose possibly structuring it like this for consistency. Here's an example of one of the Rows updated to include the registry and also replacing name with registry reserving name for the named data types (which aren't needed for execution but could be useful for UIs).
The above program requires an input in this format:
You need to denote the register as
d1
,d2
, andd3
, but the Aleo WASMgetFunctionInputs
(e.g.aleoWASM.Program.fromString(value).getFunctionInputs()
) does not give the register names when nested. This is the result of just theBoard
fromgetFunctionInputs
but you can see if gives the child registers but not thed
registers within the Board struct.I would propose possibly structuring it like this for consistency. Here's an example of one of the Rows updated to include the
registry
and also replacingname
withregistry
reservingname
for the named data types (which aren't needed for execution but could be useful for UIs).The text was updated successfully, but these errors were encountered: