Talk:XSVL

From Esolang
Jump to navigation Jump to search

some observations

Hey, I was looking through your source code and noticed a couple of things. It's perfectly fine the way it is but I feel these may be helpful if you go on to more complex projects

If you'd like you can declare an array of arbitrary size in C# by typing the following

static <type>[] <array name> = new <same type>[<array size>];

You can also convert a character to it's ASCII code by (int)<char> so you can convert digits in a text file to actual numbers with the following

<byte> = (int)<char>;
if(<byte> >= (int)'0' && <byte> <= (int)'9')
    <int> = <byte> - 48; //C# has a lot of ways to do this bit, this is just most similar to how I do it in C

While this doesn't pertain to XSVL, stacks are common in esolangs both as data structures and they're useful for implementing certain flow-control like nested conditionals and subroutines. C# has built in stack functionality

Stack <stack name> = new Stack();

I hope this is helpful and not too condescending to whoever reads it "ArthroStar11 (talk) 06:09, 2 October 2021 (UTC)" P.S. I have no Idea how to get single character user input in C# either :S