Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add node script #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

patarapolw
Copy link

@patarapolw patarapolw commented Mar 16, 2022

I don't know how you would feel about having JavaScript in your repo, but every TypeScript users will definitely have Node installed.

You need to randomize a number to make a new game, anyway.

/index.js filename is due to simply running node . works.

@johanneslumpe
Copy link
Owner

Hey, thanks for this! Right now I'm not yet quite sure how I want to handle game randomization. I'm not sure I'm a fan of using regular expressions to parse the array from the definition file in order to get to the length. To me this relies too much on the file layout and is another thing to maintain if changes were made to that file. I also wouldn't want people to have to run the script initially when they just want to load up the project, as well as not having it work in an online sandbox due to having to generate files first.

This is something I want to eventually support but as of now I think that it it's a bit overkill. As for using JS: I would definitely want to stay 100% TS :)

@patarapolw
Copy link
Author

patarapolw commented Mar 16, 2022

Another way is getting the location of [ and ] somehow (s.indexOf(']', s.indexOf('[')) in JavaScript).

About avoiding JavaScript, it is also possible via Bash script and Power Shell script. (needs both)

Online sandbox is another problem. Not sure how to handle randomization there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants