58 lines
1.8 KiB
C++
58 lines
1.8 KiB
C++
/* *********************************************************************** */
|
|
/* lab1.hpp 980910 */
|
|
/* Headerfil för lab1 */
|
|
/* *********************************************************************** */
|
|
/* Daniel Westerberg */
|
|
/* Christian Ohlsson */
|
|
/* Anna-Maria Haglund */
|
|
/* Ingela Johansson */
|
|
/* Charlotta Lagerkvist */
|
|
/* *********************************************************************** */
|
|
|
|
#include <dos.h>
|
|
#include <conio.h>
|
|
#include <stdlib.h>
|
|
#include <iostream.h>
|
|
|
|
typedef int bool;
|
|
const bool TRUE=-1, FALSE=0;
|
|
|
|
const int K=6; //Konstant för antal kassor
|
|
const int R=8; //Konstant för antal sekunder per vara
|
|
const int B=20; //Konstant för betalning
|
|
const int T=100; //Konstant för hur mycket snabbare än real-time det går
|
|
const int MS=1000; //Konstant för antal ms på en sekund
|
|
const int SPM=60; //Antal sekunder per minut
|
|
const int STARTTID=9*SPM*SPM+SPM; //Gör att programmet startar 9.01
|
|
const int MOVEX=5; //Antal steg att flytta i X-led
|
|
const int CENT=100; //Ger 100% att starta med
|
|
const int FALL1=10; //Ger 10% chans
|
|
const int FALL2=40; //Ger 30% chans
|
|
const int FALL3=90; //Ger 50% chans
|
|
const int MAV=40; //Ger slumptal mellan 1 - 40
|
|
|
|
class queue
|
|
{
|
|
private:
|
|
typedef struct kund
|
|
{
|
|
struct kund *next;
|
|
int varor;
|
|
} kund;
|
|
|
|
kund *first;
|
|
kund *last;
|
|
kund *cur;
|
|
|
|
public:
|
|
char r;
|
|
queue();
|
|
~queue();
|
|
bool enqueue(int);
|
|
bool dequeue();
|
|
int warez();
|
|
int pay(int);
|
|
int queueSize();
|
|
bool isEmpty();
|
|
};
|