当前位置: 首页>>代码示例>>C++>>正文


C++ Play类代码示例

本文整理汇总了C++中Play的典型用法代码示例。如果您正苦于以下问题:C++ Play类的具体用法?C++ Play怎么用?C++ Play使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Play类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: set_random_flac

void set_random_flac(int i) {
	if (list.size() > 0) {
		int n = rand()%list.size();
		string filename = list[n];
		list.erase(list.begin() + n);
		switch(i) {
			case 0:
				deck0_play = 0;
				deck0_amp = 0.0;
				lo_send(address, "/1/fader1", "f", 0.0);
				lo_send(address, "/1/toggle1", "i", 0);
				lo_send(address, "/1/toggle2", "i", 0);

				deck0.delete_buffer();
				deck0 = Play(filename.c_str());
				deck0.set_loop(0);
				lo_send(address, "/1/rotary3", "f", 1.0);
				lo_send(address, "/1/toggle1", "i", 1);
				break;
			case 1:
				deck1_play = 0;
				deck1_amp = 0.0;
				lo_send(address, "/1/fader2", "f", 0.0);
				lo_send(address, "/1/toggle3", "i", 0);
				lo_send(address, "/1/toggle4", "i", 0);

				deck1.delete_buffer();
				deck1 = Play(filename.c_str());
				deck1.set_loop(0);
				lo_send(address, "/1/rotary6", "f", 1.0);
				lo_send(address, "/1/toggle3", "i", 1);
				break;
		}
	}
}
开发者ID:ryo-okabayashi,项目名称:pa,代码行数:35,代码来源:cldj.cpp

示例2: main

int main()
{
  srand(time(0));
  Play game;
  game.run();

  return 0;
}
开发者ID:eileda,项目名称:Number-Game,代码行数:8,代码来源:main.cpp

示例3: main

int main() {
    Play pp;
    vector<TreeNode *> v = pp.generateTrees(5);
    for(int i = 0; i < v.size(); ++i) {
        cout << "\n NUMBER: " << i << '\n';
        pp.walk(v[i]);
    }

    return 0;
}
开发者ID:luckynoob,项目名称:Leetcode,代码行数:10,代码来源:generateBST.cpp

示例4: main

int main() {
    Play pp;
    string t, p;
    while(cin >> p) {
        cin >> t;
        cout << "Index: " << pp.kmp(t,p) << endl;
    }

    return 0;
}
开发者ID:luckynoob,项目名称:Leetcode,代码行数:10,代码来源:stringMatch_KMP.cpp

示例5: main

int main() {
    vector<vector<int> > mat {{1, 4, 6, 8},
        {9, 13, 15, 20},{30, 40, 50, 60}};

    Play pp;
    if(pp.searchMatrix(mat, 50))
        cout << "Found !\n";

    return 0;
}
开发者ID:luckynoob,项目名称:Leetcode,代码行数:10,代码来源:search2Dmatrix.cpp

示例6: main

int main() {
    Play pp;
    int a[] = {2,1,4,5,1,3,3};
    int n = sizeof(a) / sizeof(int);
    vector<int> h = pp.arrToVec(a, n);

    pp.printV(h);
    cout << pp.largestRectArea(h) << '\n';

    return 0;
}
开发者ID:luckynoob,项目名称:Leetcode,代码行数:11,代码来源:largestRectHistgram.cpp

示例7: main

int main()
{
	using namespace std;

	cout << "Tic Tac Toe version " << VERSION <<
	endl << "\t by TEAM ALPHA" << endl << endl;

	Play player;

	player.start();

	return 0;
}
开发者ID:ThrosturX,项目名称:Alpha,代码行数:13,代码来源:game.cpp

示例8: main

int main() {
    Play pp;
    ListNode *head, **h = &head;
    int x, t;
    cin >> x;
    while(cin >> t) {
        *h = new ListNode(t);
        h = &(*h)->next;
    }
    
    head = pp.partition(head, x);
    printList(head);

    return 0;
}
开发者ID:luckynoob,项目名称:Leetcode,代码行数:15,代码来源:partitionList.cpp

示例9: main

int main() {
    Play pp;
    vector<int> num {-1,0,1,2,-1,-4};
    printV(num);

    vector<vector<int> > v = pp.threeSum(num);
    printVV(v);

    vector<int> uu {-3, -2, -5, 3, -4};
    int t = -1;
    int m = pp.threeSumClosest(uu, t);
    printV(uu);
    cout << "Target: " << t << " sum: " << m << endl;

    return 0;
}
开发者ID:luckynoob,项目名称:Leetcode,代码行数:16,代码来源:3sum.cpp

示例10: main

int main() {
    Play pp;
    TreeNode A(1), B(2), C(2), D(3), E(4), F(5), G(4), H(3);

    TreeNode *r = &A;
    A.left = &B, A.right = &C;
    if(pp.isSymmetric(r)) cout << "Symmetric !\n";

    B.left = &D, B.right = &E;
    C.left = &G, C.right = &H;
    if(pp.isSymmetric(r)) cout << "Symmetric !\n";

    G.left = &F;
    if(pp.isSymmetric(r)) cout << "Symmetric !\n";

    return 0;
}
开发者ID:luckynoob,项目名称:Leetcode,代码行数:17,代码来源:symmetricTree.cpp

示例11: makeMove

void Arbiter::makeMove(Play &play) 
{
	for(;;){
		Card card = player.getCard();
		if(checkMoveValidity(play, card, hand)){
			hand.removeCard(card);
			play.receiveCard(card);
			break;
		}
	}
}
开发者ID:phantom10111,项目名称:BridgeTCS3,代码行数:11,代码来源:Arbiter.cpp

示例12: makeDummyMove

void Arbiter::makeDummyMove(Play &play) 
{
	for(;;){
		Card card = player.getDummyCard();
		if(checkMoveValidity(play, card, *dummyHand)){
			dummyHand->removeCard(card);
			play.receiveCard(card);
			break;
		}
	}
}
开发者ID:phantom10111,项目名称:BridgeTCS3,代码行数:11,代码来源:Arbiter.cpp

示例13: checkMoveValidity

bool Arbiter::checkMoveValidity(Play &play, Card &card, Hand &hand)
{
	if(!hand.hasCard(card)) {
		return false;
	}
	auto & tricks = play.getTricksView(); 
	if (tricks.empty() || tricks.back().getCardsView().size() == 4) {
		return true;
	} 
	auto & cards = tricks.back().getCardsView();
	Card firstCard = cards.front();
	if (hand.hasSuit(firstCard.suit) && firstCard.suit != card.suit) {
		return false;
	}
	return true;
}
开发者ID:phantom10111,项目名称:BridgeTCS3,代码行数:16,代码来源:Arbiter.cpp

示例14: main

int main() {
    Play pp;
    int pre[] = {0,0,0,0,0,1,0,0,0,1,0,1,0,1,0,1,0,0,0,0,0,1,0};
    int k = sizeof(pre)/ sizeof(int);
    int m = 4;
    vector<vector<int> > a = pp.format(pre, m, k);

    pp.print(a);
    cout << pp.uniquePathII(a) << '\n';


    int pb[] = {1,2,3,8,4,3,2,1,5,3,2,3,1,4,5,3,6};
    k = sizeof(pb)/sizeof(int);
    m = 4;
    a = pp.format(pb, m, k);

    pp.print(a);
    cout << pp.minPathSum(a) << '\n';

    return 0;
}
开发者ID:luckynoob,项目名称:Leetcode,代码行数:21,代码来源:uniquePath.cpp

示例15: WinMain

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
	ChangeWindowMode(true);
	SetGraphMode(640, 480, 16);
	DxLib_Init();
	SetDrawScreen(DX_SCREEN_BACK);
	SetDrawMode(DX_DRAWMODE_BILINEAR);
	SetMainWindowText("禁断の果実と楽園の護人");

	//int titlebg = LoadGraph("picture/taitol.bmp");
	int titletext = LoadGraph("picture/title.bmp");
	int bg = LoadGraph("picture/playbg_2.bmp");
	int tree = LoadGraph("picture/bigtreekai.bmp");
	char key[256];
	Opening openingscene;
	Play playscene;
	MusicSelect musicselect;
	Result resultscene;

	enum{
		OPENING,
		PLAY,
		MUSICSELECT,
		RESULT
	}scene=OPENING;

	while(Process(key)){
		switch(scene){
		case OPENING:
			DrawGraph(0, 0, bg, false);
			DrawGraph(0, 0, tree, true);
			DrawGraph(0, 0, titletext, true);
			if( ProcessMessage() == -1 ){
				break ;        // エラーが起きたらループを抜ける
			}
			openingscene.UpDate();
			openingscene.Draw();
			if(key[KEY_INPUT_LEFT]==1 || openingscene.HitJudge() == true){
				scene = MUSICSELECT;
				
			}

			if(key[KEY_INPUT_ESCAPE]==1){
				DxLib_End();
			}
			break;

		case MUSICSELECT:
			if( ProcessMessage() == -1 ){
				break ;        // エラーが起きたらループを抜ける
			}
			DrawGraph(0, 0, bg, false);
			DrawGraph(0, 0, tree, true);
			musicselect.UpDate();
			musicselect.Draw();
			if(musicselect.HitJudge() == true){
				playscene.Loadfile(musicselect.GetMusicfile());
				playscene.SetMusic(musicselect.GetMusic());
				playscene.SoundPlay();
				scene = PLAY;
			}
			if(key[KEY_INPUT_UP]==1){
				scene = PLAY;
			}

			if(key[KEY_INPUT_ESCAPE]==1){
				DxLib_End();
			}
			break;

		case PLAY:
			if( ProcessMessage() == -1 ){
				break ;        // エラーが起きたらループを抜ける
			}
			DrawGraph(0, 0, bg, false);
			DrawGraph(0, 0, tree, true);
			playscene.UpDate();
			playscene.Draw();
			if(key[KEY_INPUT_RIGHT]==1 || playscene.isPlaying() == false){
				playscene.SoundStop();
				scene = RESULT;
			}

			if(key[KEY_INPUT_ESCAPE]==1){
				DxLib_End();
			}
			break;
		
		case RESULT:
			DrawGraph(0, 0,bg, false);
			resultscene.Update();
			resultscene.Draw();
			if(key[KEY_INPUT_DOWN]==1 || resultscene.HitJudge() == true){
				scene = OPENING;
			}

			if(key[KEY_INPUT_ESCAPE]==1){
				DxLib_End();
			}
			break;
//.........这里部分代码省略.........
开发者ID:Butanosuke,项目名称:Kikori,代码行数:101,代码来源:Main.cpp


注:本文中的Play类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。