-
Notifications
You must be signed in to change notification settings - Fork 489
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
README should show all levels when entering epic mode #159
Comments
Hello - Is this still open? As a newbie, I'd like to take this on if possible. I've already sifted through the cli package to get a feel for how I'd approach this proposal. |
After mapping out all the files/calls, my high level plan would be to add a call that generates an EpicReadme.md file to the async playEpicMode() function. This call would sit before the while loop that plays each level. In addition, I'd have to create a new EpicReadme.md template. Thoughts? |
Hello @Supermn54, thanks for your interest in the project!
Sure, I'll mark it as claimed.
If you see, the README is generated when preparing the next level. As you already noticed, this is not enough for the proposed change, we need to generate the README when entering epic mode (to add all the levels to it). However, it's not necessary (nor optimal) to generate it when playing the game. We can generate it when preparing epic mode. Now, for the template, there's no need to generate another template. Instead of passing a single level to the template, we can pass an array of levels. If not in epic mode, we would just pass a single level inside the array. If in epic mode, we pass all levels. Then, inside the template, we iterate over each level in the array and render the level portion. If anything is not clear, please let me know! |
Thanks @olistic! For some reason, I didn't think the current README template structure supported the requested README outline but now I see how we can simply add loops into each section of the template. As for updating the prepareEpicMode() function, I was thinking of adding this. generateProfileFiles() and then updating the generateReadmeFile() function with code to create an array of 'data' objects for each level. I'm embarrassed to say that I'm a little stuck in figuring out the false condition for the loop. I'm trying to figure out what would return false if the loop exceeds the number of available levels (without applying a fixed number of levels). Any ideas? If I can get past this, I think I'm ready to start testing and submitting my PR. |
Assuming that you pass a |
Sorry. I should have been more clear. The issue isn't with the loop in the template. It's with creating the array of levels that are passed to the template. The generateReadmeFile() only passes a single object 'data' to the ejs.render() function. My assumption is that we instead now need to create an array of objects to be passed to the ejs.render() function instead. I'm struggling to figure out the logic to stop the loop from iterating through each level as I create the array. I can give it a fixed value but I imagine you don't want to restrict the number of levels in future towers. |
Ahh, gotcha. For the |
So basically, when generating the README, we’ll create an array of levels which will have a single element when not in epic mode (the level with the number |
Currently, when entering epic mode the README is frozen in the last level of the tower. When you're trying to fine-tune the score for a level other than the last one, it would be helpful if we had the README for that level available. The proposal is that when entering epic mode, the README is updated with all levels, one following the other.
Example:
The text was updated successfully, but these errors were encountered: