My answer
2 2 op_mul 3 3 op_mul op_add
answer is 0xD
2 2 OP_MUL 3 3 OP_MUL OP_ADD
stack programming assignment solution: 2 2 OP_MUL 3 3 OP_MUL OP_ADD
I came up with the same answer. but my execution in the stack was 0xD ?
This is correct, the stack displays variables in HEX format where D = 13
Done.
2 2 op_mul 3 3 op_mul OP_ADD
The result, D, is hex format for 13 as said before.
Starts making fun!
Answer Script:
2 2 op_mul 3 3 op_mul op_add
Hi all, here’s my solution for the Stack Programming assignment (OP_MUL and OP_ADD).
2 2 OP_MUL
3 3 OP_MUL
OP_ADD
2 2 op_mul 3 3 op_mul op_add
2 2 op_mul #places 22 = 4 onto the stack
3 3 op_mul #places 33 = 6 onto the stack
op_add #adds the two items on the stack to make 13 or d
2 2 OP_MUL
2 1 op_substr
2 2 op_add
1 2 op_substr
op_add
0xD
is this right ?? i still got 0xD i messed around till i got 0xD but i see other have 2 2 op_mul 3 3 op_mul then they op_add …
Unfortunately this is incorrect, you must multiply twice and then add the results of multiplications together.
OP_SUBSTR returns a substring and is not useful in your example.
Hi everyone. I recently finished the javascript for beginners course.
Would anyone be able to advise me on the following;
Would moving straight into the bitcoin programming 101 be too advanced at my current stage?
Does the Bitcoin programming 101 course teach how to build on the Bitcoin SV blockchain? Is it the same language?
Thanks in advance for anyone who can help
Depends on your knowledge, you can always try out and if you get stuck you can go check Blockchain and Bitcoin 101 and go back when you’re ready
Both use script as their language, but BSV might have added some additional functionality not present in BTC. I don’t know since I never used BSV.
Thanks that answers my question, very much appreciated.
Assignment answer:
2 2 op_mul 3 3 op_mul op_add
2 2 op_mul 3 3 op_mul op_add, is the answer. why is the answer shown as 0xD? I hope i posted this correctly.
I watched the video and now understand 0xD is hex for 13, now the question is why not just display 13, is there an advantage to displaying hex, why were not the 2s and and the 3’s shown in Hex
Hey, its great that you came up with an answer yourself. The reason why HEX is so popular in computer science is because you can easily fit 4 bits into 1 hex character (F in hex is equal to 1111).
It makes it easier to read where if you would want to use decimals 9 would be equal to 1001.
22+33=13=0xD
2 2 op_Mul
3 3 op_mul
op_Add