3 ms·
How did you do the matrix raining code in the demo? I did not see it in the examples. I use an mp4 of that as a screen saver but would love it in terminal inste
by TedDoesntTalk 6y ago
How did you do the matrix raining code in the demo? I did not see it in the examples. I use an mp4 of that as a screen saver but would love it in terminal instead!
- Macuyiko 6y agoRelies on the asciimatics Matrix effect, looks like: https://github.com/peterbrittain/asciimatics/blob/master/asciimatics/effects.py#L556 https://github.com/peterbrittain/asciimatics/blob/master/asc...
- vortex_ape 6y agoYes! `present` is built on asciimatics.
- vortex_ape 6y agoYou can use the matrix effect by adding `<!-- effect=matrix -->` to the top of your slide! :) These effects are supported right now: fireworks, explosions, stars, matrix, plasma. I plan to add more asciimatics effects soon!
- ksaj 6y agoI'm hoping for <-- effect=gol --> for a Game of Life simulation. For whatever reason, it comes up in my talks often. It seems I exude geekness acme whenever I talk about hacking and self-propagating code.
- vortex_ape 6y agoThat would be awesome! I'll work on it and add it some time! Opened https://github.com/vinayak-mehta/present/issues/45 https://github.com/vinayak-mehta/present/issues/45 to track it :D
- vicnicius 6y agoYou mean like this? https://github.com/abishekvashok/cmatrix https://github.com/abishekvashok/cmatrix
- m3at 6y agoHere is how to do it with a few lines of bash: function matrix () { echo -e "\e[1;40m" clear while :; do echo $LINES $COLUMNS $(( $RANDOM % $COLUMNS)) $(( $RANDOM % 72 )) sleep 0.05 done|awk '{ letters="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわをん@#$%^&*()"; c=$4; letter=substr(letters,c,1);a[$3]=0;for (x in a) {o=a[x];a[x]=a[x]+1; printf "\033[%s;%sH\033[2;32m%s",o,x,letter; printf "\033[%s;%sH\033[1;37m%s\033[0;0H",a[x],x,letter;if (a[x] >= $1) { a[x]=0; } } }' }