zsh-users
 help / color / mirror / code / Atom feed
* A project to make screensaver out of Turing's morphogenesis
@ 2016-05-28 13:04 Sebastian Gniazdowski
  2016-05-29  1:09 ` Nikolay Aleksandrovich Pavlov (ZyX)
  0 siblings, 1 reply; 3+ messages in thread
From: Sebastian Gniazdowski @ 2016-05-28 13:04 UTC (permalink / raw)
  To: Zsh Users

Hello,
Zsh has floating point numbers, so it was possible to implement
Turing's morphogenesis in it:

https://asciinema.org/a/47133

I believe the images have special aesthetics because they resemble how
life is formed. Would be nice to have such a shell screen saver. For
example, on one my FreeBSD machine vt doesn't ever blank. But I don't
have experience with such software. It's nice to say "shell
screensaver", but:
- it should run only on active terminal (thought about remembering
last active terminal in a /tmp file via precmd)
- should run after some time (sched, will it play nice?)

Would anyone want to participate? To implement:
- 256 color terminals with reasonable color picking
- screensaver like behavior
- optimization, maybe Euler method isn't best for this, code is quite slow
- other algorithms or different parameters for, or variations of morphogenesis
- use of alternate screen to not flood terminal

https://github.com/psprint/zsh-morpho

Best regards,
Sebastian Gniazdowski


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: A project to make screensaver out of Turing's morphogenesis
  2016-05-28 13:04 A project to make screensaver out of Turing's morphogenesis Sebastian Gniazdowski
@ 2016-05-29  1:09 ` Nikolay Aleksandrovich Pavlov (ZyX)
  2016-05-30 12:04   ` Sebastian Gniazdowski
  0 siblings, 1 reply; 3+ messages in thread
From: Nikolay Aleksandrovich Pavlov (ZyX) @ 2016-05-29  1:09 UTC (permalink / raw)
  To: Sebastian Gniazdowski, Zsh Users

28.05.2016, 16:05, "Sebastian Gniazdowski" <sgniazdowski@gmail.com>:
> Hello,
> Zsh has floating point numbers, so it was possible to implement
> Turing's morphogenesis in it:
>
> https://asciinema.org/a/47133
>
> I believe the images have special aesthetics because they resemble how
> life is formed. Would be nice to have such a shell screen saver. For
> example, on one my FreeBSD machine vt doesn't ever blank. But I don't
> have experience with such software. It's nice to say "shell
> screensaver", but:
> - it should run only on active terminal (thought about remembering
> last active terminal in a /tmp file via precmd)
> - should run after some time (sched, will it play nice?)

I would suggest to code this as separately as possible, maybe even as a separate plugin. I do not think that zsh is the right language to implement Turing’s morphogenesis, but I think that you are not the only one wanting a screensaver in a terminal. So the idea is that code which deduces when to run the screensaver, switches to alternate screen, renders the screensaver and disables it should know a single thing about Turing’s morphogenesis: that it needs to run `$SCREENSAVER_COMMAND $LINES $COLUMNS` to get the screensaver rendered.

I am not the one wanting screensaver in the terminal though, so I will not participate. I am sometimes answering questions on this ML though.

>
> Would anyone want to participate? To implement:
> - 256 color terminals with reasonable color picking
> - screensaver like behavior
> - optimization, maybe Euler method isn't best for this, code is quite slow
> - other algorithms or different parameters for, or variations of morphogenesis
> - use of alternate screen to not flood terminal
>
> https://github.com/psprint/zsh-morpho
>
> Best regards,
> Sebastian Gniazdowski


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: A project to make screensaver out of Turing's morphogenesis
  2016-05-29  1:09 ` Nikolay Aleksandrovich Pavlov (ZyX)
@ 2016-05-30 12:04   ` Sebastian Gniazdowski
  0 siblings, 0 replies; 3+ messages in thread
From: Sebastian Gniazdowski @ 2016-05-30 12:04 UTC (permalink / raw)
  To: Nikolay Aleksandrovich Pavlov (ZyX); +Cc: Zsh Users

On 29 May 2016 at 03:09, Nikolay Aleksandrovich Pavlov (ZyX)
<kp-pav@yandex.ru> wrote:
> 28.05.2016, 16:05, "Sebastian Gniazdowski" <sgniazdowski@gmail.com>:
>> Hello,
>> Zsh has floating point numbers, so it was possible to implement
>> Turing's morphogenesis in it:
>>
>> https://asciinema.org/a/47133
>>
>> I believe the images have special aesthetics because they resemble how
>> life is formed. Would be nice to have such a shell screen saver. For
>> example, on one my FreeBSD machine vt doesn't ever blank. But I don't
>> have experience with such software. It's nice to say "shell
>> screensaver", but:
>> - it should run only on active terminal (thought about remembering
>> last active terminal in a /tmp file via precmd)
>> - should run after some time (sched, will it play nice?)
>
> I would suggest to code this as separately as possible, maybe even as a separate plugin. I do not think that zsh is the right language to implement Turing’s morphogenesis, but I think that you are not the only one wanting a screensaver in a terminal.

The images are now quite nice:

https://asciinema.org/a/47242

It's nice to see such image when returning to my FreeBSD box. Also
added basic Mandelbrot set generation. What I want to say is that
screen saver needs images, images often need math. That said, you may
be right that Zsh isn't proper language. The code is slow. Takes 60
seconds on 600 MHz Pentium M machine, 11 seconds on 2,3 GHz Core i5.
Had to use hashes because arrays do not store lengths. Wonder why the
code cannot run faster, the function solve_one_iteration isn't that
large and complex. It's in fact very simple.

> So the idea is that code which deduces when to run the screensaver, switches to alternate screen, renders the screensaver and disables it should know a single thing about Turing’s morphogenesis: that it needs to run `$SCREENSAVER_COMMAND $LINES $COLUMNS` to get the screensaver rendered.

The basic Mandelbrot generation shows how to make a new screen saver:

https://github.com/psprint/zsh-morpho/blob/master/zmandelbrot

One standard block of code that handles traps, alternate screen,
cursor hiding, plus one plain loop. The code handles external
commands, running the already existing "cmatrix" is possible via
single zstyle. More info at project's page:

https://github.com/psprint/zsh-morpho

Best regards,
Sebastian Gniazdowski


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-05-30 12:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-28 13:04 A project to make screensaver out of Turing's morphogenesis Sebastian Gniazdowski
2016-05-29  1:09 ` Nikolay Aleksandrovich Pavlov (ZyX)
2016-05-30 12:04   ` Sebastian Gniazdowski

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).