-
Notifications
You must be signed in to change notification settings - Fork 69
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
The Ackermann functions are not actual generators #24
Comments
Indeed you are correct. But the actual behavior is intended. But I'll look if I can improve this. Also if by chance your updates are working you can make a PR. |
By actual behaviour, do you mean generating a unique number, instead of a series of numbers? Or the fact that it cannot be called from the command line? |
Not usable from the command line. |
Right, the rate of increase was another concern I have about it. I guess it can be useful to hide very little information in a very large image. For the command line interface, I have figured out how to cleanly call the function and pass it its arguments. However, it is not very helpful, as the function only returns one number. This means that if you need more than 3 bits to store your data, it throw a StopIteration exception at the second call. If you changed the function to generate a series of numbers, then it could work. |
I think that passing only 'm' from the command line would be enough. I encapsulated the function in a generator: |
I have added the feature for both ackermann generators (and encapsulated the slow one). The changes are available in the PR #26. |
As the title mentions, the two Ackermann number generators in the file
generators.py
are not actual generators, for two reasons:yield
instruction, causing them to be considered as simple functions by the interpreterI believe that they should be rewritten to act as generator. A possible solution could be to have the generator start at
A(1,0)
(or any other value), and each new iteration would beA(i, 0)
, wherei
is an incremental counter.Furthermore, the two generators cannot currently be called from the
stegano-lsb-set
command line tool, as they expect two argumentsn
andm
to be passed to them. These arguments are currently not grabbed by the parser.Edit: Added body of the issue
The text was updated successfully, but these errors were encountered: