#include <iostream>
using namespace std;
#include "SqList.h"
#include "Functions.h"
#include "FuncRef.h"

int main()
{
	int N; // 牌的面值数，N<10
	cout << "Enter N: ";
	cin >> N;
	if (N < 1 || N > 9)
	{
		cout << "Invalid input!" << endl;
		exit(1);
	}
	SqList<int>* PA = new SqList<int>; // PA的手牌
	InitList(*PA, N);
	SqList<int>* PB = new SqList<int>; // PB的手牌
	InitList(*PB, N);

	DealCards(N, PA, PB);
	DispList(*PA);
	DispList(*PB);

	cout << "------------------------------" << endl;
	cout << "Game Play 1" << endl;
	GamePlay1(*PA, *PB, N);
	cout << "------------------------------" << endl;
	cout << "Game Play 2" << endl;
	GamePlay2(*PA, *PB, N);

	DestroyList(*PA);
	DestroyList(*PB);
	delete PA;
	delete PB;
}