This official news post is copied verbatim from the WoTMUD website. It is copyrighted by wotmud.org.

This update was added on December 17 2003 by Zun.

I have a couple openings for programmers who want to do some hard-coding for the mud.

Although we've done this kind of thing in the past, it hasn't ever worked out well, but I thought I'd give it a shot again.

Here's how I'd like it to work this time:

  • You must know how to code in C and/or C++, on a Linux system.
  • You will need to get a copy of Circle 2.20 and be familiar with how it works (www.circlemud.org), as well as run it on your own. This was the original codebase for the mud.
  • We will start out by having you work on some projects I have in mind that only need the basic Circle stuff. You will submit code to me and I will incorporate it into the mud. You may keep your copyright but we will need all rights to your code.
  • You will have creative discretion in how to implement the projects as long as they meet my requirements.
  • As you complete projects successfully and gain my confidence as well as Flash's, you will gradually get access to the codebase.
  • With successful projects under your belt, you will get the opportunity to propose and implement projects of your own, as long as they are in keeping with the vision and theme of the mud.

Let me just say that you will have to be a pretty good programmer for me to consider working with you, and since I work in the software industry I know how rare that is I am willing to mentor you to some degree, but I do not want to spend untold hours debugging your code.

If you're interested, mail me and tell me about yourself, your qualifications, and any prior mud coding experience (if any).

    • Due to the level of interest, I'm also going to ask that you submit a solution to the problem code below... make sure it works first and try different lists of things! **
    • E-mail your code to me at wot@zun.org **

By the way, if you're a Java guru, talk to me separately.

. . . Zun.

Code:

/* problem.c



   Programming problem:

     Complete this program by writing the save() and restore() functions

     correctly.



     You may use any standard C or C++ library functions, and pick your own file

     format.



     Correctness counts more than how fast you finish this.  Your functions

     must pass a more difficult test than the one shown here (i.e. a more

     complicated list of things)



     Your solution will be rated by the following priorities:

     1. Correctness

     2. Clarity

     3. Performance

*/



#include <stdio.h>

#include <stdlib.h>

#include <string.h>



/* a thing has a name, and can have other things "in it"

   if it is in a container, it is linked to the other contents of the container

   all things are also linked together

 */



struct thing {

  char *name;

  struct thing *next_in_container;

  struct thing *contents;

  struct thing *next;

};



struct thing *create_thing(char *name)

{

  struct thing *t = malloc(sizeof(struct thing));

  t->name = strdup(name);

  t->next_in_container = 0;

  t->contents = 0;

  t->next = 0;

  return t;

}



/* save will save the list of things to the file fp by converting the

   linked list of thing structures to text, in some format

*/

void save(struct thing *list, FILE *fp)

{

  /* you need to implement this function! */

}



/* restore will create a new list of things by reading the text from fp

   that was created by a previous save

*/

struct thing *restore(FILE *fp)

{

  /* you need to implement this function! */

  return 0;

}



/* running this program with just one argument should save a hard-coded

   list of things to the file named by the argument



   running this program with two arguments will read a list of things from

   the first file and write the same list out to the second file

   if this program is working correctly, both files should be identical

*/



int main(int argc, char **argv)

{

  struct thing *list_of_things = 0;

  FILE *in, *out;



  if (argc != 2 && argc != 3) {

    fprintf(stderr, "usage: %s <outfile>n", argv[0]);

    fprintf(stderr, "   or: %s <infile> <outfile>n", argv[0]);

    exit(1);

  }



  if ((out = fopen(argc == 2 ? argv[1] : argv[2], "w")) == NULL) {

    fprintf(stderr, "couldn't open %s for writing!n",

            argc == 2 ? argv[1] : argv[2]);

    exit(1);

  }



  if (argc == 2) {

    struct thing *sack, *diamond, *rock, *pickaxe;



    sack = create_thing("a sack");

    diamond = create_thing("a shiny diamond");

    rock = create_thing("a dirty rock");

    pickaxe = create_thing("a pickaxe");



    sack->contents = diamond;

    diamond->next_in_container = rock;

    rock->next_in_container = 0;



    list_of_things = sack;

    sack->next = pickaxe;

    pickaxe->next = diamond;

    diamond->next = rock;

    rock->next = 0;



    save(list_of_things, out);



    fclose(out);

    exit(0);

  }



  if ((in = fopen(argv[1], "r")) == NULL) {

    fprintf(stderr, "couldn't open %s for reading!n", argv[1]);

    fclose(out);

    exit(1);

  }



  list_of_things = restore(in);

  save(list_of_things, out);



  fclose(out);

  fclose(in);

  exit(0);

}


[ This Mail was edited by: Zun on 2003-12-18 22:25 ]

Community content is available under CC-BY-SA unless otherwise noted.