Script - Bitcoin Programming Discussion

Welcome to the discussion about this section. Here you can ask questions or post feedback about this specific lecture.

Assignment Answer

2 2 OP_MUL 3 3 OP_MUL OP_ADD

Answer:
3 3 OP_MUL 2 2 OP_MUL OP_ADD

2 2 op_mul 3 3 op_mul op_add

2 2 OP_MUL
3 3 OP_MUL
OP_ADD

Give us something harder guys, this is too basic :stuck_out_tongue:

Edit: I’ve decided do also do it without disabled operations, i.e. without OP_MUL and using only OP_ADD

2 2 OP_ADD
3 3 OP_ADD 3 OP_ADD
OP_ADD
1 Like
2 2 OP_MUL
3 3 OP_MUL
OP_ADD

The program.

The evaluation :
<program above> ==> 4 3 3 OP_MUL OP_ADD ==> 4 9 OP_ADD ==> 13

1 Like

The reverse Polish notation seems to be unfortunately omitted in the video

2 * 2 + 3 * 3
==> 2*2 | 3* 3 | +
==> [ [2; 2; *] ; [3; 3; *] ; + ]

1 Like

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

1 Like

I have a general question: What are the most known or most used stack-based programming languages?

Answer:

2 2 OP_MUL
3 3 OP_MUL
OP_ADD

1 Like

There are not many, apart from low level assembly languages. According to wikipedia some of the most common ones are Forth, RPL, PostScript, BibTeX.

2 Likes

ans: 02 02 OP_MUL 03 03 OP_MUL OP_ADD

1 Like

2 2 op_mull 3 3 op_mul op_add

1 Like

OK, well noted, thanks!

1 Like

@filip, the link to the Bitcoin IDE you’re using is missing on lecture https://ivanontech.teachable.com/courses/521188/lectures/9723976 Thanks!

I used this bitcoin IDE to test.

2 2 OP_MUL 3 3 OP_MUL OP_ADD

@Capaburro I agree with your answer now. Looks like you’re the only one who got it technically correct: to actually add 4+9 (not 9+4 like most are answering :).

answer
2 2 OP_MUL 3 3 OP_MUL OP_ADD

Thank you. Updated :slight_smile: