Script - Bitcoin Programming Discussion

I’m not sure tbh :smile: it was probably disabled because it not actually used on the blockchain, but it is useful to grasp the concept and you can play around with it on Bitcoin IDE.
For a simple case of multiplying something by 2 using addition like you demonstrated would suffice.

2 2 op_mul 3 3 op_mul op_add

1 Like

Here is my answer:
2 2 OP_MUL
3 3 OP_MUL
OP_ADD

It threw me off when the Bitcoin IDE displays 0 x D on the screen.

1 Like

haha sweet! happy days then :smile:

2 2 op_mul 3 3 op_mul op_add

Multiplication first then addition of the totals

1 Like

image

1 Like

Loving the intro to Script! It’s very logical and has clear rules. Brilliant job of explaining, Filip!!

2 2 OP_MUL 3 3 OP_MUL OP_ADD

Stack Visualizer: 0xD

1 Like

Answer:

2 2 OP_MUL
3 3 OP_MUL
OP_ADD

1 Like

1 Like

Answer:

2 2 OP_MUL
3 3 OP_MUL
OP_ADD

1 Like

The answer is:
2 2 OP_MUL
3 3 OP_MUL
OP_ADD

1 Like
2 2 op_mul
3 3 op_mul 
op_add

First i had trouble figuring that D is actually 13. What the thing about D equals to words ? Is A = 10, B=11 …?

Yes, the IDE uses hex number format, it is explained in the later videos. :slight_smile:

Stack Programming Assignment:

2 2 op_mul
3 3 op_mul
op_add
1 Like

1 Like

2 3 op_mul 1 7 op_mul op_add

am i wrong for writing it this way …
2 3 OP_MUL 1 7 OP_MUL OP_ADD (to get 13)?

This translates to (2 * 3) + (1 * 7). Try using BTC IDE to figure out the correct answer :wink:

https://siminchen.github.io/bitcoinIDE/build/editor.html

1 Like

Stack programming assignment answer :

1 Like

Assignment answer:
2 2 op_mul 3 3 op_mul op_add

1 Like