nassi's logo

Nassi Tutorial, Lecture 1


[ Lecture 1 | Lecture 2 | Lecture 3 | Lecture 4 ]


This is a small tutorial that should give you a first impression of nassi's capabilities. It is divided into 4 lectures:

Starting nassi

Unless you want to run nassi in batch-mode, just type nassi - optionally followed by the name of a C or PASCAL source file, that you want to work on.

Assume you have the following file named tut1.c in your current working directory:

/* a demo program that does nothing useful,
   but contains all Nassi-Shneiderman structure elements
*/

#include <stdlib.h>
#include <stdio.h>

char *function_nr1(char *draw_hints);

void main() {
    printf("result = '%s'\n",function_nr1("some parameter"));
}

char *function_nr1(char *parameter) {
    char  *dummy1,dummy2[100];
    int   i;
    
    do {
      for(dummy1=parameter,i=0; dummy1; dummy1++) {
	printf("%c",*dummy1);
	switch(*dummy1) {
	case 'a':
	  fprintf(stderr,"Too bad, it was an a\n");
	  return function_nr1(dummy1);
	case 'b':
	  fprintf(stderr,"Thank god, I found a b\n");
	  return dummy1;
      default:
	if(dummy1 == parameter) {
	  printf("- First cut -");
	} else {
	  dummy2[i++] = *dummy1;
	}
	break;
	}
      }
      return parameter+i; /* an important comment */;
    } while(TRUE);
}

and you type nassi tut1.c. Then nassi's GUI should come up:

nassi's gui

The main window consists of several areas.

After clicking on 'function_nr1' and resizing the main window, you will see the following:

nassi's gui

You can already learn quite a few things about nassi from this simple example.

On the next page, you will learn how to use the option buttons in the top row.


[ Lecture 1 | Lecture 2 | Lecture 3 | Lecture 4 ]


Back to main Nassi page