pxt
pxt copied to clipboard
New block: 'char code from text'
Is your feature request related to a problem? Please describe. It's hard to make a Caesar cipher program in MakeCode blocks, but very easy in text-based languages like Python. MakeCode has a 'text from char code' block but I can't see the opposite block that would be 'char code from text' https://makecode.microbit.org/reference/math/from-char-code It seems odd to have one block and not the other.
Describe the solution you'd like A new block: 'char code from text'. This would take a single character string and return an integer of its ASCII code. It should error if given strings that are not 1 character in length.
Describe alternatives you've considered I can't think of any simple way of doing it in blocks suitable for an elementary class. I need to convert text into a number before I can transform it by adding or subtracting a numerical key. Other solutions using alphabet arrays or strings would be complex for students to code.
i need this block too
I could really use it for teaching the Caesar cipher in MakeCode blocks.
Related issues - https://github.com/microsoft/pxt-arcade/issues/3844, https://github.com/microsoft/pxt-microbit/issues/5311
Tracked in Microbit release.