Archive for the ‘code’ category

C is in

February 8, 2007

I’ve been working on IC in C (that’s kinda’ fun to say in the “J2 in the ER” way*). I did a paste, it’s at [dead paste] , but it’s only good for 24hrs, so it might not be there when you click. Otherwise, check: http://71.201.65.239/projects/imagecloud/ . No, the site isn’t finished either.

*See “Lucy, Daughter of the Devil” from Adult Swim or http://www.youtube.com/watch?v=SdbP0rEtPrQ

Advertisements

Crazy Pascal Assignment

November 8, 2006

My semester project in pascal is self assigned. I’ve written a proposal letter to the teacher to make ImageCloud in pascal. The python verison is not really even helpful in this besides being a psuedocode for the pascal. This is what I have so far. He hasn’t even green-lighted the idea yet. Here’s hoping…

program FileReader(input, output);

uses
    DOS;

const
    MAXDBSIZE = 224;
type
    StrArray = array [0..(MAXDBSIZE-1)] of String;

var
    pathname : String;
    filelist : StrArray;

procedure glob(var filelist : StrArray);
    var
	s : SearchRec;

        x : integer;
        pathname : String;
    begin

        x := 1;
        filelist[0] := ' ';

          Writeln('Please enter a directory to search in:');
	Readln(pathname);
        findfirst(pathname + '*.*', AnyFile, s);

	if s.name <> '' then
	  while (x < MAXDBSIZE) and (s.name <> filelist[x-1]) do

	    begin
	      filelist[x] := s.name;

              x := x + 1;
              findnext(s)

	    end
	else
          writeln('No files in that directory!');

        x := 1;

        while (x < MAXDBSIZE) and (s.name <> filelist[x-1]) do

          begin
            writeln(filelist[x]);
            x := x + 1;

          end;
    end;

procedure UserInput;
  var

    inputchar : char;
    foo, jello : integer;

  begin
    foo := 0;
    jello := 0;

    inputchar := ' ';
      repeat
        write('Do you want to [B]rowse, [A]dd, or [Q]uit? >>');

        readln(inputchar);
          case inputchar of
	    'a','A': begin

	      glob(filelist);
	      jello := jello + 1;

	      end;
	    'b','B': begin
	      glob(filelist);

	      jello := jello + 1;
	      end;
	    'q','Q': begin

	      glob(filelist);
	      jello := jello + 1;

	      end;
	  end;
      until jello <> foo;
  end;

begin {main}
UserInput;
end.

Comics 0wnzrs..

September 10, 2006

http://xkcd.com/c138.html – It’s all I have to say 🙂