Skip to content

Instantly share code, notes, and snippets.

View laserbat's full-sized avatar

Olga Ustiuzhanina laserbat

View GitHub Profile
def getLine(self,x1, y1, x2, y2):
"""Bresenham's line algorithm"""
points = []
issteep = abs(y2-y1) > abs(x2-x1)
if issteep:
x1, y1 = y1, x1
x2, y2 = y2, x2
rev = False
if x1 > x2:
x1, x2 = x2, x1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%$!#######!$%%%%%%%%%%%%%%
%%%%%!.........!%%%%%%%%%%%%%%
%%%%%#.........#%%%%%%%%%%%%%%
%%%%%#.........#%%%%%%%%%%%%%%
%%%%%#.........#%%%%%%%%%%%%%%
%%%%%#.........#%%%%%%%%%%%%%%
%%%%%!.........!%%%%%%%%%%%%%%
%%%%%$!#######!$%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#!/usr/bin/perl
use Curses;initscr;refresh;noecho;curs_set cbreak;$pd=3;$ph=10;$zd=7;$zh=40;sub z{for$x(0..$w){for$y(0..$h){if($zo[$x][$y]<=0){$z[$x][$y]=0;$zo[$x][$y]=0}for(0..20){$zxn=int(rand 3)-1;$zyn=int(rand 3)-1;if(!$l[$x+$zxn][$y+$zyn]){last}}if(!int(rand 5)and$le[$x][$y]and$x!=$yy and$y!=$yx){$z[$x][$y]=1;$zo[$x][$y]=$zh}else{$z[$x][$y]=0}if($z[$x][$y]){$z[$x+$zxn][$y+$zyn]=$z[$x][$y];$zo[$x+$zxn][$y+$zyn]=$zo[$x][$y]}if(int(rand 5)and!o($x,$y)and$zxn or$zyn){$z[$x][$y]=0;$zo[$x][$y]=0}if(o($x,$y)and$z[$x][$y]){$ph-=$zd-int(rand 3);flash;addstr(22,0,"The zombie hits!".' 'x10);refresh}}}}sub p{a: $m=getc;if($m==8){$yy2--}elsif($m==2){$yy2++}elsif($m==4){$yx2--}elsif($m==6){$yx2++}elsif($m==9){$yx2++;$yy2--}elsif($m==7){$yx2--;$yy2--}elsif($m==1){$yx2--;$yy2++}elsif($m==3){$yx2++;$yy2++}elsif($m eq'q'){endwin;exit}else{goto a}if($z[$yy2][$yx2]){$zo[$yy2][$yx2]-=$pd+int(rand 3);flash;addstr(22,0,"You hit the zombie!".' 'x10);refresh;($yy2,$yx2)=($yy,$yx);$hz=1}if($le[$yy2][$yx2]and!$z[$yy2][$yx2]){($yy
#!/usr/bin/perl
$_=99072;$o=int(10*cos()**sin());@a=(45906,68783,26026);$l=107618;$a[@a]=$a[0]^$a[1]^$a[2]^$l;$f
[@f]=(10000*(cos()**sin()))foreach@a;s!$_!print(chr($o+sqrt))foreach(@f)!e&&printf(chr$o/(@f-1))
<!--
PHP MRPAS
Copyright (c) 2010 Dominik Marczuk
All rights reserved.
#!/usr/bin/env python
"""
PHP MRPAS
Copyright (c) 2010 Dominik Marczuk
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
<!--
PHP MRPAS
Copyright (c) 2010 Dominik Marczuk
All rights reserved.
linux-0qkn:/opt/CutlassRL # chroot ./ /usr/bin/python
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
ImportError: No module named site
linux-0qkn:/opt/CutlassRL # chroot ./ ./usr/bin/python
Python 2.7 (r27:82500, Aug 07 2010, 16:54:59) [GCC] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "/etc/pythonstart", line 16, in save_history
readline.write_history_file(historyPath)
linux-0qkn:/opt/CutlassRL # ls
bin dgamelaunch.20110709 dgl_menu_main_anon.txt lib
CutlassRL dgl-banner dgl_menu_main_user.txt mail
dev dgl-default-rcfile.nh343 dgl_menu_watchmenu_help.txt src
dgamelaunch dgldir etc usr
linux-0qkn:/opt/CutlassRL # chroot ./ /dgamelaunch
chroot: failed to run command `/dgamelaunch': No such file or directory