One Hat Cyber Team
Your IP :
216.73.216.80
Server IP :
194.44.31.54
Server :
Linux zen.imath.kiev.ua 4.18.0-553.77.1.el8_10.x86_64 #1 SMP Fri Oct 3 14:30:23 UTC 2025 x86_64
Server Software :
Apache/2.4.37 (Rocky Linux) OpenSSL/1.1.1k
PHP Version :
5.6.40
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
systemtap
/
examples
/
stapgames
/
Edit File:
lifegame.stp
#!/usr/bin/stap # lifegame # Copyright (C) 2008 Masami Hiramatsu <masami.hiramatsu@gmail.com> # # This file is free software and is distributed under the terms of the GNU # General Public License (GPL); either version 2, or (at your option) any # later version. global X_MAX=15, Y_MAX=15 global map, tmp global t function showupdate() { print("\033[1;1H\033[J") # clear screen delete map foreach([x,y] in tmp) { printf("\033[%d;%dH", y+1, x+1) # move cursor print("o") map[x,y] = 1 } delete tmp } function lookaround(x,y) { return map[x-1,y-1] + map[x,y-1] + map[x+1,y-1] + map[x-1,y ] + map[x+1,y ] + map[x-1,y+1] + map[x,y+1] + map[x+1,y+1] } probe timer.ms(10) { t ++ if (t == Y_MAX) { showupdate() t = -1 next # skip to the next timer. } # updating just 1 line y = t for (x=0; x < X_MAX; x++) { c = lookaround(x,y) if (c == 3) tmp[x,y] = 1 else if (c == 2 && [x,y] in map) tmp[x,y] = map[x,y] } } probe begin { tmp[6,5] = 1; tmp[5,6] = 1; tmp[4,7] = 1; tmp[5,7] = 1 tmp[6,7] = 1 showupdate() t = -1 }
Simpan