pxt icon indicating copy to clipboard operation
pxt copied to clipboard

New block: 'char code from text'

Open microbit-giles opened this issue 3 years ago • 1 comments

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.

microbit-giles avatar Aug 06 '21 15:08 microbit-giles

i need this block too

carlostmgps avatar Apr 16 '22 11:04 carlostmgps

I could really use it for teaching the Caesar cipher in MakeCode blocks.

runeschmidt avatar Dec 15 '23 13:12 runeschmidt

Related issues - https://github.com/microsoft/pxt-arcade/issues/3844, https://github.com/microsoft/pxt-microbit/issues/5311

Jaqster avatar Dec 15 '23 17:12 Jaqster

Tracked in Microbit release.

abchatra avatar Feb 14 '24 18:02 abchatra