#include <safe-c.h>

void main(void)
{
  string_type band;
  string_type name;
  boolean_type asking;
  integer_type tries;

  put_string("Welcome to bquiz0!\n");
  put_string("What's Your name?\n");
  get_string(name);
  put_string("Hello ");
  put_string(name);

  asking = TRUE;
  tries = 0;
  while (asking)
  {
    tries = tries + 1;
    put_string("Here is your question:\n");
    put_string("Who is the best band of all time?\n");
    get_string(band);
    if (string_equal(band, "Pink Floyd\n"))
    {
      put_string("Yes - Well done!!!\n");
      asking = FALSE;
    }
    else
    {
      put_string("No - silly!\n");
      if (tries == 3)
      {
        asking = FALSE;
        put_string("Too many attempts!\n");
      }
    }
  }
}     
