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

Line.TryDodosuko3 method is too strict #1

Open
noppikinatta opened this issue Aug 2, 2022 · 3 comments
Open

Line.TryDodosuko3 method is too strict #1

noppikinatta opened this issue Aug 2, 2022 · 3 comments

Comments

@noppikinatta
Copy link
Owner

TryDodosuko3 method outputs ドド or スコ 4 times per a call.
if output result is not ドドスコスコスコ, it returns false.

But, a call of TryDodosuko3 may outputs (ドド|スコ){2}ドドスコ, and next call of TryDodosuko3 may outputs スコスコドドスコ.

In this case ドドスコ of 1st output and スコスコ of 2nd output succeeds to build ドドスコスコスコ.
But TryDodosuko3 returns false, and love is not injected.

@junderw
Copy link

junderw commented Aug 2, 2022

I think you should turn Dodosuko3 into a state machine.

ドド will set state to 1,
スコ will increase state count by 1,
Then we can return state >= 4 as bool.

Each attempt will try only 4 times, but state will be kept between calls.

What do you think?

@junderw
Copy link

junderw commented Aug 2, 2022

Maybe if it reaches 4 it should return early, so that extra ドド or スコ don't get printed...

@noppikinatta
Copy link
Owner Author

Thanks.

That's right. I am considering separating the implementation into an iterator and a state machine.

I also believe the implementation of TryDodosuko3 should be changed. When I first wrote the code, I implemented it with the vision of Fungo executing (ドド(スコ){3}){3} ラブ注入♡. However, that was a mistake. When Fungo executes (ドド(スコ){3}){3} ラブ注入♡ in the real world, the string generated by Fungo is deterministic. Therefore, there is no problem with the process of generating three (ドド(スコ){3})s. However, this is not the case in ddskgen. Therefore, if we make decisions in units of (ドド(スコ){3})s, as in TryDodosuko3, we will find patterns that do not cover (ドド(スコ){3})s that span each unit.

I'm thinking of creating an iterator that simply returns ドド or スコ, and the iterator references a state machine that determines whether (ドド(スコ){3}){3} has been established with a value from 0 to 12. When the state machine reaches 12, the iterator sets the return value of the Next method to false.

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

No branches or pull requests

2 participants