-
Notifications
You must be signed in to change notification settings - Fork 56
Generate command table #531
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
Conversation
I just had to make it well-aligned. 😅
But I am not sure how to best get the description. Do you have any tips or suggestions, @byorgey or @TristanCacqueray? |
Getting Haddock comments is a good idea, but I don't know off the top of my head how to extract them in a nice way... |
Even TH could do it, but only on newer GHC - https://discourse.haskell.org/t/ghc-9-2-1-released/3527. If there was an easy way with TH/Generics/some package I would use docstrings, but I do not think it is viable <9.2. Writing documentation for players separately is not so bad and will be simpler Haskell. ✍️ |
I wrote it manually, could you please take a look @byorgey? Here is the gist of the resulting markdown table: https://gist.github.com/xsebek/3e8b679f4dad68a7fdf1021abdd95872 |
Another idea: maybe we could split the table into
And below that have a section per each command/function with a longer description like we have for Entities. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! We should somehow make these descriptions available in the Commands (F4) pop-up as well (in another PR).
Sounds good, I have no particular opinions on how the table should be formatted. |
I just checked and it seems that all 4 cheat sheets are either unfinished or outdated, so maybe we could automatically generate documentation for all of them. |
@noahyor I known, that is the plan 😎 We could even update the wiki in CI, but I do not plan to automate that anytime soon. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few little things.
] | ||
Move -> commandLow 0 "Move forward one step." | ||
Turn -> commandLow 1 "Turn in some direction." | ||
Grab -> commandLow 0 "Grab an item from the current location." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grab -> commandLow 0 "Grab an item from the current location." | |
Grab -> commandLow 0 "Grab an item from the current cell." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I do not think a player will find the "cell" understandable. My understanding is that "cell" is more of a game developer term than gamer slang.
Turn -> commandLow 1 "Turn in some direction." | ||
Grab -> commandLow 0 "Grab an item from the current location." | ||
Harvest -> | ||
commandLow 0 . doc "Harvest an item from the current location." $ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commandLow 0 . doc "Harvest an item from the current location." $ | |
commandLow 0 . doc "Harvest an item from the current cell." $ |
, "Otherwise it works exactly like 'grab'" | ||
] | ||
Place -> | ||
commandLow 1 . doc "Place an item at the current location." $ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commandLow 1 . doc "Place an item at the current location." $ | |
commandLow 1 . doc "Place an item in the current cell." $ |
commandLow 1 . doc "Place an item at the current location." $ | ||
["The current location has to be empty for this to work."] | ||
Give -> commandLow 2 "Give an item to another robot closeby." | ||
Install -> commandLow 2 "Install a device from inventory on a robot." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Install -> commandLow 2 "Install a device from inventory on a robot." | |
Install -> commandLow 2 "Install a device from inventory on given robot reference." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think installing stuff on references makes sense.
commandLow 2 . doc "Reprogram another robot with new command." $ | ||
["The other robot has to be closeby and idle."] | ||
Drill -> | ||
commandLow 1 . doc "Drill through an entity." $ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commandLow 1 . doc "Drill through an entity." $ | |
commandLow 1 . doc "Drill through a drillable entity." $ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I am content leaving that discovery to the player. 😄
Anyway, if you wanted to include some specifics, I would suggest doing it in the longer description.
Appear -> | ||
commandLow 1 . doc "Set how the robot is displayed." $ | ||
[ "You can either specify one character or five (for each direction)." | ||
, "The default is \"X^>v<\"." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the 'X' ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the robot is looking down. So it looks like four robots meet.
Anyway, I would like to make that customizable one day, so that powerline font users can choose prettier versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand, but how would the player ever be able to see that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean build {move; turn down}
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*gape* Wow, I never knew that a robot cold turn downwards!
Random -> | ||
commandLow 1 . doc "Get a uniformly random integer." $ | ||
["The random integer will be from the range 0 to END inclusive of your choice."] | ||
Run -> commandLow 1 "Run a program loaded from a file." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Run -> commandLow 1 "Run a program loaded from a file." | |
Run -> commandLow 1 "Run a program from a file." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not too clear on the semantics here, but loading the program from a file sounds like English to me. 🤨
Co-authored-by: Brent Yorgey <[email protected]> Co-authored-by: Noah Yorgey <[email protected]>
So he said, as he went to write |
I think I now get what Emacs referred to as builtins. Instead of having their list hardcoded, I can simply add a few predicates to split consts rougly into functions, operators and commands. Technically operators are also functions, but for documentation purposes we keep them separate.
Behold!The ultimate command wiki is here! It has hyperlinks:
Separate sections for functions and operators:
And finally, detailed descriptions, which we can expand in the future:
|
Looks great! |
We should link to the wiki page in the Commands dialog. |
Well done @xsebek! |
@byorgey I would prefer to include the info in the game. It would be nice to have the commands expandable, so when you select it and hit Enter it would show similar info as the wiki. Or we could have a separate view for the currently selected command similar to how we have inventory and info panel. But for the moment a link must suffice:
This might be my first commit changing the UI! 😆 |
constSig = case processParsedTerm (noLoc $ TConst c) of | ||
Right (ProcessedTerm (TConst _) (Module pt _) _ _) -> " : " <> prettyText pt | ||
_ -> "??" | ||
constSig = " : " <> prettyText (inferConst c) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TristanCacqueray Hah, I see you had fun drawing the Const
type too! 😀
@xsebek yes, including this info in the game would be great, but this is way better then nothing! |
Generate table for Commands Cheat Sheet Wiki.