>From: "Tristan M" <[EMAIL PROTECTED]>
>To: [email protected]
>Subject: RE: isolating 1 character from a string
>Date: Wed, 12 May 2004 20:13:08 +0000
>
>Ok, ive been mucking around with this for hours now with no luck, ill try
to explain what this is supposed to do...
>
>every room that it checks is already there, that happens earlier in the
function and it works perfectly, what this part is supposed to do is go
through each room(vnums 1000-1100[its going to become MUCH larger
afterwards, just until i get it working) and link them up into a big square
where every room is linked to one another...
>
>this is what ive got so far, you guys got any ideas?
>
>{
>blah blah blah....other code is here, that works successfully
>}
> for( room = 1000 ; room < 1100 ; room++)
> {
> int firstchar;
> int nvalue;
> char *original;
> char string1;
> char *string2;
>
>
> ch->desc->editor = ED_ROOM;
>
> sprintf(buf,"%d",room);
> do_goto(ch, buf );
> string2 = "";
>
> original = buf;
> if ( original[0] != '\0' )
> {
> string1 = original[0];
> string2 = &original[3];
> }
>
> sprintf(buf,"%c",string1);
> firstchar = atoi(buf);
> sprintf(buf,"%c",string2);
> nvalue = atoi(buf);
>
>
> if ( firstchar == 100 )
> {
>
> if ( nvalue == 0 )
> {
> /*Room South*/
>
> do_redit(ch, buf);
> offset = room + 10;
> sprintf(buf2, "%s", offset);
> redit_south(ch, buf2 );
> /*Room East*/
>
> do_redit(ch, buf);
> offset = room + 1;
> sprintf(buf2, "%s", offset);
> redit_east(ch, buf2 );
> }
> if (( nvalue >= 1 ) && ( nvalue <= 8 ))
> {
> /*Room South*/
>
> do_redit(ch, buf);
> offset = room + 10;
> sprintf(buf2, "%s", offset);
> redit_south(ch, buf2 );
> /*Room East*/
>
> do_redit(ch, buf);
> offset = room + 1;
> sprintf(buf2, "%s", offset);
> redit_east(ch, buf2 );
> /*Room West*/
>
> do_redit(ch, buf);
> offset = room + 1;
> sprintf(buf2, "%s", offset);
> redit_west(ch, buf2 );
> }
> if ( nvalue == 9 )
> {
> /*Room South*/
>
> do_redit(ch, buf);
> offset = room + 10;
> sprintf(buf2, "%s", offset);
> redit_south(ch, buf2 );
> /*Room West*/
>
> do_redit(ch, buf);
> offset = room - 1;
> sprintf(buf2, "%s", offset);
> redit_east(ch, buf2 );
> }
> }
>
> if ( firstchar == 101 )
> {
> if ( nvalue == 0 )
> {
> /*Room North*/
>
> do_redit(ch, buf);
> offset = room - 10;
> sprintf(buf2, "%s", offset);
> redit_south(ch, buf2 );
> /*Room South*/
>
> do_redit(ch, buf);
> offset = room + 10;
> sprintf(buf2, "%s", offset);
> redit_south(ch, buf2 );
> /*Room East*/
>
> do_redit(ch, buf);
> offset = room + 1;
> sprintf(buf2, "%s", offset);
> redit_east(ch, buf2 );
> }
> if (( nvalue >= 1 ) && ( nvalue <= 8 ))
> {
> /*Room North*/
>
> do_redit(ch, buf);
> offset = room - 10;
> sprintf(buf2, "%s", offset);
> redit_south(ch, buf2 );
> /*Room South*/
>
> do_redit(ch, buf);
> offset = room + 10;
> sprintf(buf2, "%s", offset);
> redit_south(ch, buf2 );
> /*Room East*/
>
> do_redit(ch, buf);
> offset = room + 1;
> sprintf(buf2, "%s", offset);
> redit_east(ch, buf2 );
> /*Room West*/
>
> do_redit(ch, buf);
> offset = room + 1;
> sprintf(buf2, "%s", offset);
> redit_west(ch, buf2 );
> }
> if ( nvalue == 9 )
> {
> /*Room North*/
>
> do_redit(ch, buf);
> offset = room - 10;
> sprintf(buf2, "%s", offset);
> redit_south(ch, buf2 );
> /*Room South*/
>
> do_redit(ch, buf);
> offset = room + 10;
> sprintf(buf2, "%s", offset);
> redit_south(ch, buf2 );
> /*Room West*/
>
> do_redit(ch, buf);
> offset = room - 1;
> sprintf(buf2, "%s", offset);
> redit_east(ch, buf2 );
> }
> }
>
> if ( firstchar == 109 )
> {
> if ( nvalue == 0 )
> {
> /*Room North*/
>
> offset = room - 10;
> sprintf(buf2, "%s", offset);
> redit_south(ch, buf2 );
> /*Room East*/
>
> offset = room + 1;
> sprintf(buf2, "%s", offset);
> redit_east(ch, buf2 );
> }
> if (( nvalue >= 1 ) && ( nvalue <= 8 ))
> {
> /*Room North*/
>
> offset = room - 10;
> sprintf(buf2, "%s", offset);
> redit_south(ch, buf2 );
> /*Room East*/
>
> offset = room + 1;
> sprintf(buf2, "%s", offset);
> redit_east(ch, buf2 );
> /*Room West*/
>
> offset = room + 1;
> sprintf(buf2, "%s", offset);
> redit_west(ch, buf2 );
> }
> if ( nvalue == 9 )
> {
> /*Room North*/
>
> offset = room - 10;
> sprintf(buf2, "%s", offset);
> redit_south(ch, buf2 );
> /*Room West*/
>
> offset = room - 1;
> sprintf(buf2, "%s", offset);
> redit_east(ch, buf2 );
> }
> }
> }
>
>_________________________________________________________________
>MSN Premium includes powerful parental controls and get 2 months FREE*
http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines
>
>
>--
>ROM mailing list
>[email protected]
>http://www.rom.org/cgi-bin/mailman/listinfo/rom