|
"I've seen more information on a frickin' sticky note!" - Dave Kreskowiak
|
|
|
|
|
I keep getting traffic from a random video game website. I think one of the members of their forums set their avatar to an image hosted on my site (or something like that).
|
|
|
|
|
that's when i replace the image in question with something which might cause the hot-linker some embarrassment.
|
|
|
|
|
IT'S PORNO TIME!!
|
|
|
|
|
|
I like the way you're thinking, Chris!
Will Rogers never met me.
|
|
|
|
|
Some student probably set it up, and forgot about it.
The States were just as bad for things like this a few years ago, when it was all newish there, too. Hundreds of kiddies doing things that they probably now realise were a waste of everyone's time.
With China, the sheer number of such kiddies makes for a lot of traffic.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
kmoorevs wrote: failed login attempts for the user 'scan' and 'Administrator' neither of which are valid user names for that machine
Now there's a mistake.
You should have said that they are valid user names, but that they hadn't got the passwords right.
Keeping 'em busy doing what won't work is one of the most effective defences.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
|
This is the first descent code I wrote when I began to make programs, it was in C++
Is about an algorithm to arrangle ships in a classic battleship game, first funcion is to check if a ship can be placed at x;y second is for placing the ship and 3th was for placing all the ships. I was so amazed that the code worked that I felt a joy I only felt few times since then.
How about you
bool TGame::Free(int x,int y,int size,int pos,int board )
{
int ship[7];
int side1[7];
int side2[7];
bool answer=true;
if(aBoard[board]->GetInfo(x,y)!=0)
{
return answer=false;
}
if (pos==1)
{
for(int i=0;i<size+2;i++)
{ship[i]=aBoard[board]->GetInfo(x-1+i,y);
side1[i]=aBoard[board]->GetInfo(x-1+i,y-1);
side2[i]=aBoard[board]->GetInfo(x-1+i,y+1);
}
}
else
{ for(int i=0;i<size+2;i++)
{ship[i]=aBoard[board]->GetInfo(x,y-1+i);
side1[i]=aBoard[board]->GetInfo(x-1,y-1+i);
side2[i]=aBoard[board]->GetInfo(x+1,y-1+i);
}
}
if (x==0 && pos==1)
{ship[0]=0;
side1[0]=0;
side2[0]=0;
}
for (int i=0;i<size+2;i++)
{if (ship[i]!= 0)answer=false;
if (side1[i]!= 0)answer=false;
if (side2[i]!= 0)answer=false;
}
return answer;
}
void TGame:: RandomShip(int size,int type,int board,int ship)
{
int pos=random(2);
randomize();
int x,y;
bool answer=false; ;
if (pos==1)
{
while (answer==false)
{
x=random(11)-size;
while(x<0)
{x=random(11)-size;
}
y=random(15);
answer=Free(x,y,size,pos,board);
}
for(int i=0;i<size;i++)
{aBoard[board]->SetInfo(x+i,y,type);
}
}
else
{
while (answer==false)
{
x=random(10);
y=random(16)-size;
while(y<0)
{y=random(16)-size;
}
answer=Free(x,y,size,pos,board);
}
for(int i=0;i<size;i++)
{aBoard[board]->SetInfo(x,y+i,type);
}
}
if(board==0)
{
int ax=Transform(x);
int ay=Transform(y);
aPosXY[ship].x=ax;
aPosXY[ship].y=ay;
aPosXY[ship].pos=pos;
}
}
void TGame::RandomAllocation(int board)
{
RandomShip(5,6,board,0);
RandomShip(4,5,board,1);
RandomShip(3,4,board,2);
RandomShip(3,3,board,3);
RandomShip(2,2,board,4);
RandomShip(2,1,board,5);
}
|
|
|
|
|
My first descent code was a recursive descent parser[^]. I'm not sure if it was decent, though!
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Clever!
Regards,
Mike
|
|
|
|
|
I too thought the first recursive descent parser I ever wrote was absolutely amazing.
|
|
|
|
|
I guess the first decent code I ever wrote was an operating system and assembler for the Intel 8080 in an Altair 8800 microcomputer. I wasn't all that surprised that it worked, though, as I'd carefully hand crafted all the bytes myself, entering them with 8 toggle switches, so errors were more "expensive" back then.
Will Rogers never met me.
|
|
|
|
|
Roger Wright wrote: entering them with 8 toggle switches Ah, the good old days.
I did that on a PDP-11/05 at school. The machine had an 80 word bootstrap that was fairly easy to wipe by accident, so you had to fat-finger it in via the front panel switches. I only had to do it once or twice, and it took me a few minutes. Reportedly there was a guy who could do it in less than 60 seconds. If you think about it, though, that implied if you became practiced at it, your code was pretty bad to create the problem in the first place.
Software Zen: delete this;
|
|
|
|
|
Hehehe... My bootstrap loader, once I got the whole package punched to paper tape, was only 16 bytes, so it wasn't too laborious to enter. The real challenge was the first time. Power wasn't all that reliable, and it seemed that every time I got close to loading the entire system, the power blinked. Then it would fail while I was trying to punch the image to tape. All in all, it took about 6 days to finally get the first version entered into RAM and successfully punched to tape. After that it was smooth sailing, since I could do maintenance and extensions to the system using my assembler. That was a great feeling!
Will Rogers never met me.
|
|
|
|
|
My step-dad had a COSMAC ELF[^] single-board computer with 2K RAM on board. We fat-fingered in a 1.5K Tiny Basic interpreter (which took forever). He rigged up a battery backup using an old car battery, which kept the thing alive for months at a time.
Software Zen: delete this;
|
|
|
|
|
Gary Wheeler wrote: rigged up a battery backup using an old car battery
Great thought! I considered something like that, but the 8080 needed +5, +12, and -12 Vdc, and it just didn't seem practical at the time. In retrospect, it would have been a heck of a lot cheaper than wasting my time for so many days.
Will Rogers never met me.
|
|
|
|
|
My step-dad's a E.E. and a genuine Renaissance man in terms of being handy at these sorts of things.
Software Zen: delete this;
|
|
|
|
|
Yeah, we E.E.s are handy that way.
Will Rogers never met me.
|
|
|
|
|
The feeling after writing my first decent piece of code was awesome, thanks for the reminder, it'll make work go great today.
|
|
|
|
|
Vasily Tserekh wrote: so amazed that the code worked that I felt a joy I only felt few times since then. A great feeling indeed! Congratulations!
/ravi
|
|
|
|
|
I was able to boil that down to 3 lines.
I'd show you the code, but then I'd have to charge you for it.

|
|
|
|
|
The correct comeback should be "I can get it down to 3 lines but there's not enough room in the margin to write it".
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
|
|
|
|
|
Please give yourself 5points for that
|
|
|
|
|