Inomdla kwaye iyonwabisa umbhalo-ngqangi endiyifumene kwi IParadesiLinux eyenza amakhekhe ekhephu awa ngokungenammiselo kwikhonsoli yethu.
Ikhowudi ekubhekiswa kuyo yile:
[ikhowudi]#! / bin / ibash
IMigca = $ (imigca yokufaka)
IINKCUKACHA = $ (tput cols)
Yazisa -Amahlwantsi ekhephu
Yazisa -Iiflakes zokugqibela
kucace
umsebenzi ushukuma_flake () {
i = »$ 1 ″
ukuba ["$ {amahlwantsi ekhephu [$ i]}" = ""] || ["$ {Amakhekheba ekhephu [$ i]}" = "$ LINES"] emva koko
Iikhephu [$ i] = 0
enye
ukuba ["$ {lastflakes [$ i]}"! = ""]; emva koko
ushicilelo "\ 033 [% s;% sH \ 033 [1; 1H" $ {iiflakes zokugqibela [$ i]} $ i
fi
fi
ushicilelo "\ 033 [% s;% sH❄ \ 033 [1; 1H" $ {amakhekheba ekhephu [$ i]} $ i
iiflakes zokugqibela [$ i] = $ {amakhekhe ekhephu [$ i]}
amakhekhe ekhephu [$ i] = $ (($ {amakhekhe ekhephu [$ i]} + 1))
}
ngelixa:
do
i = $ (($ RANDOM% $ COLUMNS))
intshukumo_flake $ i
ye x kwi "$ {! iiflakes zokugqibela [@]}"
do
intshukumo_flake "$ x"
Zenziwe
ukulala 0.1
Zenziwe
Siyigcina kwifayile kwaye siyinike naliphi na igama, masithi Ikhephu.sh. Emva koko siyinika imvume yokuphumeza:
$ chmod +x nevando.sh
kwaye siyiphumeza kwisiphelo
$ ./nevando.sh
Konke okuseleyo kukubeka ingoma yeKrisimesi ngasemva
Ukuhamba kade koku, kodwa ke
Kancinci emva kwexesha kwabo bavela kumantla e-hemisphere, kodwa kwakhona, kancinci kwasekuqaleni kwabo bavela kwi-hemisphere esemazantsi.