@venezia is on PowPing!

PowPing is a place where you can earn Bitcoin simply by socializing, for FREE.
Never tried Bitcoin? It's OK! Just come, socialize, and earn Bitcoin.
Check out venezia's activities

Bitcoin Script

visit channel home
Total Economy: 1.01 USD
Happy weekend everyone! This channel is growing so fast! Hope you can find some fun from here. We can use Bitcoin scripts to manipulate data in bytes. OP_CAT is used to connect data. OP_SPLIT is used to split data. Challenge: Can you use OPCODEs to change the string "abc" to "ABC"?
joe tipped:
0.88 USD
1 year ago
I have no idea if this actually works, because I don't have visual studio installed yet to test, but something like: "abc" 1 OP_SPLIT 1 OP_SPLIT OP_BIN2NUM 00100000 OP_XOR OP_8 OP_NUM2BIN OP_ROT OP_BIN2NUM 00100000 OP_XOR OP_8 OP_NUM2BIN OP_ROT OP_BIN2NUM 00100000 OP_XOR OP_8 OP_NUM2BIN OP_ROT OP_ROT OP_CAT OP_CAT split out each character and convert each to binary numbers, then XOR each by 32 (space character), then convert each back to characters and finally combine. Oh, I'm also not really a programmer so this could be totally wrong. :-)
joe tipped:
0.05 USD
1 year ago
venezia tipped:
0.02 USD
1 year ago
joe replied:
Ayyy. You got the right idea (I'm going to assume the code works as intended). However, you can make this muuuuch more efficient, stick to this idea tho
light replied:
Hmm, so maybe I can skip the whole binary conversion step then? "abc" 1 OP_SPLIT 1 OP_SPLIT 32 OP_XOR OP_ROT 32 OP_XOR OP_ROT OP_ROT OP_CAT OP_CAT
light replied:
Oh, and I figured out that the VS Code plugin doesn't actually have a debugger yet. That make me sad. :-(
venezia replied:
Using XOR to get the capitalization of letters is very cool! By the way, you can try to use the bsv js library to run the code. The fork of Scrypt is recommended, they remove some obsolete constraints. https://github.com/scrypt-sv/bsv
light replied:
Thanks!!
adonsats replied:
FORTH IS FOR NON programmer. that is the beauty of concatenative.
🧐 this is ASCII manipulation. distance btw a and A 🤓
venezia tipped:
0.02 USD
1 year ago
adonsats replied:
I confess that I do not know how to do that in script but I will try to search.
Hehe. Luckily, with a fixed size strings you can do some ASCII magic and make this an easy answer... However, I'm going to take a break from poaching these questions so others have an opportunity to answer them :) Keep em coming though!
venezia tipped:
0.07 USD
1 year ago
venezia replied:
You are so generous!
joe replied:
Don't sweat it man, thank you for making these daily Script brain teasers. I enjoyed them :)