Delete lab.cpp

This commit is contained in:
Valk Richard Li 2019-07-28 00:00:25 +08:00 committed by GitHub
parent 141f4e9d26
commit e57153286c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 116 deletions

116
lab.cpp
View File

@ -1,116 +0,0 @@
#include <iostream>
#include "var.h"
using namespace nasal;
using namespace std;
int main()
{
PrintString("This is a testing programme. \n");
NasalHash m;
int a=1;
std::string k="hello world!";
PrintString(k);
m.Append("first",&a,"int");
m.Append("second",&a,"int");
m.Append("third",&k,"string");
m.PrintHash();
std::cout<<std::endl;
PrintVar(m);
std::cout<<std::endl;
NasalList n;
n=m.Keys();
n.PrintList();
std::cout<<std::endl;
PrintVar(n);
std::cout<<std::endl;
m.Delete("fifth");
m.Delete("second");
m.PrintHash();
n=m.Keys();
std::cout<<std::endl;
n.PrintList();
std::cout<<std::endl;
n.Append(&n,"array");
n.Append(&n,"array");
n.PrintList();
std::cout<<std::endl;
NasalList rm;
rm.Append(&a,"int");
rm.Append(&a,"int");
rm.Append(&a,"int");
rm.PrintList();
std::cout<<std::endl;
m.Append("fifth",&rm,"array");
m.Append("sixth",&m,"hash");
m.PrintHash();
std::cout<<std::endl;
NasalHash test1(m);
test1.PrintHash();
NasalList test2(n);
std::cout<<std::endl;
test2.PrintList();
std::cout<<std::endl;
n.Append(&m,"hash");
n.PrintList();
std::cout<<std::endl<<std::endl;
NasalList qt;
qt.Append(&a,"int");
a++;
qt.Append(&a,"int");
NasalHash qthash;
qthash.Append("testlist",&qt,"array");
qthash.PrintHash();
std::cout<<std::endl;
qthash.Append("int",&a,"int");
qt.Append(&qthash,"hash");
qt.PrintList();
std::cout<<std::endl;
NasalList _l;
_l.Append(&a,"int");
_l.SetSize(10);
_l.PrintList();
std::cout<<std::endl;
_l.SetSize(3);
_l.PrintList();
std::cout<<std::endl;
_l.SetSize(0);
_l.PrintList();
std::cout<<std::endl;
_l.Append(&a,"int");
_l.Append(&a,"int");
_l.Append(&a,"int");
_l.Append(&a,"int");
_l.Append(&a,"int");
_l.Append(&a,"int");
NasalList _k;
_l.PrintList();
std::cout<<std::endl;
_k=_l.SubVec(9,4);
_k.PrintList();
std::cout<<std::endl;
_k=_l.SubVec(1,10);
_k.PrintList();
std::cout<<std::endl;
NasalList _m;
var _temp=_k.Pop();
_m.Append(&_temp,"var");
_k.PrintList();
std::cout<<std::endl;
_m.PrintList();
std::cout<<std::endl;
qthash.Append("var",&_temp,"var");
qthash.PrintHash();
return 0;
}