Publish a minigame but without letting them see the code

I want to send a replit to my friend to play, but I dont want him to see the code behind, only the application that runs of that code. How can I do it?

unfortunately, you’d have to deploy it and make the repl private, or host it yourself.

2 Likes

Is it a console game or a webpage?

you can do so by adding

hidden  = ['main', 'main.source']

in .replit, of course you need to change everything inside that square bracket into your source file, however, your code is still visible to those who clicked on the show hidden file.

one way to be safe but annoying to do is by copying the entire code into secret variables, and your actual running code consist of only obtaining the code from env vars, and execute them (if the language you are programming in supports that).
However the latter is still not absolutely safe since replit still haven’t fix the issue where secret variables can still be obtained in some way, so basically there is not yet a way to absolutely hide a code

No,

hidden = ['main', 'main.py']

IIRC

Also, Replit shows hidden files by default on the cover page now.

3 Likes

im not sure, i wrote a game that has inputs and if statemenets

and how do i do that? and after i do it, can he play it without seeing the code?

Why do you not want him to see the code?

its a choice game, i dont want him to see the outcome of the game