Python to C# Converter

OK, I know this is a bit off-topic, but I am in desperate need of a Python to C# Converter.

But the ones I found so far either needed to be downloaded (I found one Python to C# Converter, but never found it again), or just didn't work at all (Like pythoncsharp.com)

So, if you have a Python to C# Converter, online, download-free, and ACTUALLY works, can you let me know? Or if something like this doesn't exist, can you let me know?

If you can't find a Python to C# Online Compiler that is download-free and actually works, how about a Python to C (Or C++) Online Compiler (Again, that actually works and that is download-free)?

Here is the code I want to transpose into C#, C, or C++: AI Guessing Game (SOURCE CODE) - Google Docs

Try transposing it into C# with pythoncsharp.com, but just a word of warning: The transposed C# code will NOT work.

You want automatic translator to get this algorithm ?!?!?
untitled script pic (1)

Slight understatement :slight_smile:

Maybe try asking on here instead

No. The code should be bigger and there should be more variables than that.

Please look at my code before you post as my code is more than that.

You can download it on repl.it.
Also, the reason the code that doesn't work is because it doesn't change the functions and a lot of other things that cause it to not work. There's a reason why people port manually instead of depending on transpilers.

Unrelated testing things

$$
y=x^2
$$

How do you get that fancy text?

$$This-is-how-you-do-fancy-text$$
$$This-is-how-you-do-fancy-text$$

Do you know how to convert Python to C#? Cause I don't.

I saw some "Random" library tutorials online but they don't work (At least in onlinegdb.com)

Ask there.

That's literally what @cymplecy said :expressionless:

Okay, but you paid no attention to it. The Snap! forums is not for discussion of things completely unrelated to Snap!, and just saying "this may be a little off-topic" is no excuse.

oops I added newlines between the $$s

When did I say it was an excuse?

Geez, will you stop being annoying? When did I say that

is an excuse?

It doesn't matter if you said it was an excuse or not! You're still using "this may be a little off topic" as an excuse to post it on the Snap! forums instead of where it should be.
Also, don't post twice to say the same thing, and have some patience. I wasn't online for the 12 hours during which you were presumably waiting for a response.

I kinda doubt that anyone's made a good Python to C# compiler. Porting code from Python to C# isn't as simple as changing all the Python syntax to C# syntax. The two languages provide different standard functions, so you'd either need to implement the necessary Python functions in C#, or rewrite the code in idiomatic C#. Writing a program to do that automatically for every common Python function would be quite a big undertaking, and there's probably not enough demand for anyone to put in the effort. Even if someone did put in the time to do that, the compiler would probably not generate C# code that's very human-friendly.

So your best option is to port the program from Python to C# by hand. Fortunately, this is a decently simple program, so it shouldn't take too long once you have a few things figured out. You just need to learn C#'s basic syntax then look up the standard functions for generating random numbers, printing text, and getting user input. If you don't already know what each function in the Python code does, look it up, and anything you find that you don't know the C# equivalent for, also look that up. Then you'll have pretty much all the knowledge you need to rewrite the program in C#.

Oh :frowning:

The problem is that the C# Compiler I'm using (onlinegdb) doesn't know what the Random library is, and I get many errors that I don't know how to fix.