Skip to content

Instantly share code, notes, and snippets.

View djanatyn's full-sized avatar

Jonathan Strickland djanatyn

View GitHub Profile
@djanatyn
djanatyn / curses.pl
Created July 17, 2011 00:07
roguelike
#!/usr/bin/perl -w
use strict;
use Curses;
my %player = (
'health' => 100,
'x' => 5,
'y' => 5,
);
@djanatyn
djanatyn / roguelike.pl
Created July 17, 2011 01:43
special code for donri - top priority
#!/usr/bin/perl -w
use strict;
use Curses;
my $status = new Curses;
my %player = (
'health' => 100,
'x' => 5,
'y' => 5,
@djanatyn
djanatyn / main.pl
Created July 17, 2011 02:37
making steady progress
#!/usr/bin/perl -w
package Player;
use strict;
use Curses;
use Moose;
has 'health' => (is => 'rw', isa => 'Int', default => 100);
has 'x' => (is => 'rw', isa => 'Int', default => 5);
has 'y' => (is => 'rw', isa => 'Int', default => 5);
@djanatyn
djanatyn / main.pl
Created July 17, 2011 03:03
object oriented
#!/usr/bin/perl -w
package Player;
use strict;
use Curses;
use Moose;
has 'health' => (is => 'rw', isa => 'Int', default => 100);
has 'x' => (is => 'rw', isa => 'Int', default => 5);
has 'y' => (is => 'rw', isa => 'Int', default => 5);
@djanatyn
djanatyn / arrays.pl
Created July 17, 2011 20:19
arrays are weird
my @map = (
['#','#','#','#','#'],
['#','.','.','.','#'].
['#','.','.','.','#'].
['#','.','.','.','#'].
['#','.','.','.','#'].
['#','#','#','#','#']);
for(my $y, $y < 5; $y++;) {
for(my $x, $x < 4; $x++;) {
@djanatyn
djanatyn / returnvalues.pl
Created July 18, 2011 02:43
I can't believe this worked.
sub countItems {
(my $target) = @_;
open(TODO, "./.ptd") or die "please create a .ptd file";
@_ = ();
for $_ (<TODO>) { push @_, $1 if /^$target:(.*)$/; }
return @_;
}
sub printTodo {
@djanatyn
djanatyn / ptd.pl
Created July 18, 2011 06:16
it is finished.
#!/usr/bin/perl -w
use strict;
sub error {
my ($error) = @_;
print $error;
print "ptd - a todo list utility.\n";
print "usage:\n";
print " ptd <action> [options]\n";
print "actions:\n";
#!/usr/bin/perl
use strict;
use warnings;
use v5.10;
use IO::File;
use autodie;
package Entry;
sub new {
[djanatyn@barda ~]$ cat ~/.cpanm/build.log
cpanm (App::cpanminus) 1.4008 on perl 5.012004 built for i386-linux-thread-multi
Work directory is /home/djanatyn/.cpanm/work/1312584901.1227
You have make /usr/bin/make
You have /usr/bin/wget
You have /bin/tar: tar (GNU tar) 1.25
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
#!/usr/bin/perl -w
use strict;
use warnings;
use SDL;
use SDLx::App;
use SDL::Event;
use SDL::Events;