The answer is 2 2 OP_MUL 3 3 OP_MUL OP_ADD.
assignment:
2 2 OP_MUL 3 3 OP_MUL OP_ADD
Answer:
2 2 OP_MUL 3 3 OP_MUL OP_ADD
Stack Assignment
The words used in the script are found in the Bitcon script wiki page.
Script: 2 OP_2MUL 3 3 OP_MUL OP_ADD
Runs like this: 2 OP_2MUL
==> 4 3 3 OP_MUL
==> 4 9 OP_ADD
==> 0xD
Answer:
2 2 OP_MUL 3 3 OP_MUL OP_ADD
Answer:
2 2 OP_MUL
3 3 OP_MUL
OP_ADD
2 2 op_add 3 3 op_mul op_add
No correct but correct answer as 2*2=4 and 2+2=4, I should have used op_mul in the first expression.
You can edit the post btw
2 2 OP_MUL 3 3 OP_MUL OP_ADD
Done
Stack Programming Assignment answer
2 2 OP_MUL 3 3 OP_MUL OP_ADD
2 2 OP_MUL 3 3 OP_MUL OP_ADD
simple enough…
Here’s my answer:
2 2 op_mul
3 3 op_mul
op_add
This is my first time coding stack based programming, very interesting!
It feels like coding assembly xD
2 2 op_mul 3 3 op_mul op_add
2 2 op_mul 3 3 op_mul op_add
2 2 op_mul 3 3 op_mul op_add
Originally we can do:
2 2 OP_MUL 3 3 OP_MUL OP_ADD
which gives us a result of 13, or 0xD in hexidecimal.
However, the OP_MUL
operation is disabled.
So alternatively we can do:
2 2 OP_ADD 3 3 OP_ADD 3 OP_ADD OP_ADD
which uses only the OP_ADD
operation,
While this does give the same result, the formula is technically different (2 + 2 + 3 + 3 + 3
) so I wouldn’t say its really correct. For example if you change the values, you would also have to update the formula still good thinking
Hey, thanks for the feedback
Do you know how you would go about doing this then without use of the OP_MUL
disabled operation?
Cheers!