Hi,

I've been trying for a while now to figure this problem out on my own, but nothing really useful popped up in my head. I'm trying to program the so called "Langton's ant" in C.
The program should do the following:
- Create an area of the size of the users choice
- Place the 'ant' in the middle of the area
- Everytime the ant moves (it looks down at the beginning and moves on 'step' per time), a function should check whether the field (array) is empty ' ' oder has a '#' inside. If if its blank, the ant puts a '#', moves 90° to the right and continues one step. If the field is already filled with a '#' it changes it back to blank, turns 90° degrees left and moves one step forward.
As long as it didnt hit the border of the area, the function should return true and the programm should continue.

This is what I have so far (some things are still inside for testing purpose). I hope someone can give me a helping hint. I'm a bit confused by all this pointers and stuff.

Last but not least, sorry for me english, as it is not my native language.

main.c
*******
Code:
#include <stdio.h>
#include "area.h"

int nextStep (struct Ameise insect*,int len, char[][len]){
    // ???
}

int main ()
{

  char test [][5] = {"ABCDE",
                     "BCDEA",
                     "CDEAB",
                     "DEABC",
                     "EABCD"};
  showArea (5, test);
  initArea (5, test);
  showArea (5, test);
  printf ("\n");

  // Eingaben
  int laenge;
  printf ("Groesse Spielfeld: ");
  scanf ("%d", &laenge);

  if (laenge < 1)
  {
    printf ("Zu klein!\n");
    return 9998;
  }
  //einfuehren der ameise, x und y koordinaten -> mittige position, blickrichtung unten, also 2
  struct Ameise insect = {(laenge/2),(laenge/2),2};

  printf ("\n");

  // Spielfeld anlegen (variable Länge)
  char raster[laenge][laenge];

  // Spielfeld wird belegt (Leerzeichen)
  initArea (laenge, raster);

  // Mitte des Spielfeld
  // alter text raster [laenge/2][laenge/2] = 'M';
  raster [laenge/2][laenge/2] = '#';
  // Hinweis: Die Mitte liegt nur exakt, wenn 'laenge' ungerade ist.
  // Für eine gerade 'laenge' nehmen wir die entsprechende Abweichung hin.

  // Ausgabe des Spielfelds
  showArea (laenge, raster);

  return 0;
}
area.c
******
Code:
#include <stdlib.h>
#include "area.h"

void initArea (int len, char area[][len]){
    for(int i=0;i<len;i++){
            for(int j=0;j<len;j++)
                area[i][j] = ' ';
    }
}

void showArea (int len, char area[][len]){
    printline(len);
    for(int i=0;i<len;i++){
            printf("|");
            for(int j=0;j<len;j++)
                printf("%c", area[i][j]);
            printf("|\n");
    }
    printline(len);
}

void printline (int len){
    printf("+");
    for(int i=0;i<len;i++)
        printf("-");
    printf("+\n");
}
area.h
******
Code:
extern void printline(int len);
extern void initArea(int len, char area[][len]);
extern void showArea(int len, char area[][len]);
extern struct Ameise{
    int x;
    int y;
    int blick;
};
Thanks in advance.
Cheers.