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

IE-0029: Basic IO #29

Merged
merged 4 commits into from
Sep 20, 2023
Merged

IE-0029: Basic IO #29

merged 4 commits into from
Sep 20, 2023

Conversation

curiousdannii
Copy link
Collaborator

(IE-0029) Basic IO

Summary

Extend the basic IO functionality of Basic Inform, including incorporating Basic Screen Effects.

@curiousdannii curiousdannii added the formal-proposal A formal proposal that has been accepted for consideration by the core Inform team label Jul 20, 2023
@curiousdannii
Copy link
Collaborator Author

One question is how to handle number input. Inform doesn't (currently) have an option kind, so we can't return a failure. (Unless we returned it in a separate value? Very messy.) Therefore we probably want to make the phrase ask the player a second time if their input wasn't a valid answer. That means reprinting the prompt as well. So maybe something like

ask the player for a number with prompt (P - text)

@ganelson
Copy link
Owner

Isn't it better to have a phrase which inputs an arbitrary text, which can then be composed with a phrase to convert text to a number?

But there ways using inline definitions to make conditional assignments of the "if let" sort, if you reaaally want to.

@curiousdannii
Copy link
Collaborator Author

Ah, yeah that would probably be a better option. The author could use regexes to test the string is only a number (optionally wrapped in spaces), and if that check passes then parse it into a number. If it doesn't match then the author can print the prompt and ask again themselves. So then we'd only need one phrase for text input, but then a separate phrase to parse a text into a number. And maybe also to parse into a real number?

If let... I do really like them, but when I've tried it before it's been really hacky. Something to consider for the future.

@curiousdannii curiousdannii merged commit a372eb0 into main Sep 20, 2023
@curiousdannii curiousdannii deleted the ie-0029-io branch September 20, 2023 23:42
@curiousdannii
Copy link
Collaborator Author

curiousdannii commented May 2, 2024

I've begun working on this, and have more thoughts.

Status line

BSE's status line phrases are basically completely disconnected from how Inform usually displays the status line, and in particular from the constructing the status line activity.

The activity should be moved from the standard rules into basic inform. The basic IO phrase(s) would then be one particular way of using the activity.

Picking a number

DialogKit defines DirectorPickANumber. There's a lot of overlap between this and the suggested number parsing function...

curiousdannii added a commit that referenced this pull request Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
formal-proposal A formal proposal that has been accepted for consideration by the core Inform team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants