Пример #1
0
void menu()
	{
		       int h;
		       clrscr();
		       textcolor(5);
		       fr1(1,2,24,79);
		       textcolor(5);
		       fr1(3,4,22,77);
		       gotoxy(31,2);
		       textcolor(5);
		       printf("CAR RACE GAME");
		       gotoxy(36,9);
		       textcolor(0);
		       cprintf("MAIN MENU");
		       textcolor(5);
		       fr1(10,30,18,55);
		       gotoxy(35,12);
		       textcolor(1);
		       cprintf("1.");
		       textcolor(8);
		       cprintf("Play Game");
		       gotoxy(35,13);
		       textcolor(1);
		       cprintf("2.");
		       textcolor(8);
		       cprintf("Instruction");
		       gotoxy(35,14);
		       textcolor(1);
		       cprintf("3.");
		       textcolor(8);
		       cprintf("Developer");
		       gotoxy(35,15);
		       textcolor(1);
		       cprintf("4.");
		       textcolor(8);
		       cprintf("Highest Record");
		       gotoxy(35,16);
		       textcolor(1);
		       cprintf("5.");
		       textcolor(8);
		       cprintf("Exit");
		       gotoxy(14,25);
		       textcolor(RED);
		       cprintf ("Press Any Highlighted Key Word To Select Your Choice.... =");
		       scanf("%d",&h);
		       choice=h;

     }
// (4)に相当するテスト
void FractionTest::compare_fractions(void){
    Fraction fr1(6, 4);
    Fraction fr2(3, 2);
    Fraction fr3(2, 1);
    CPPUNIT_ASSERT_MESSAGE("6/4 == 3/2 should be judged true", fr1 == fr2);
    CPPUNIT_ASSERT_MESSAGE("6/4 != 2/1 should be judged true", !(fr1 == fr3));
}
Пример #3
0
void gover()
     {
	  textcolor(5);
	  fr1(10,30,18,55);
	  gotoxy(40,14);
	  cprintf("GAME OVER");
     }
Пример #4
0
void test_basic_with_assign_template(
  ForwardIterator first,ForwardIterator last
  BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(Flyweight))
{
  typedef typename Flyweight::value_type value_type;

  ForwardIterator it;

  test_basic_template<Flyweight>(first,last);

  for(it=first;it!=last;++it){
    /* value construction */

    value_type v(*it);
    Flyweight  f1(v);
    Flyweight  f2(f1.get());
    BOOST_TEST(f1.get()==v);
    BOOST_TEST(f2.get()==v);
    BOOST_TEST(f1==f2);

#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
    value_type       v1(v);
    const value_type v2(v);
    Flyweight        fr1(std::move(v1));
    Flyweight        fr2(std::move(v2));
    BOOST_TEST(fr1==v);
    BOOST_TEST(fr2==v);
#endif

    /* value assignment */

    Flyweight f3,f4;
    f3=v;
    f4=f1.get();
    BOOST_TEST(f2.get()==v);
    BOOST_TEST(f3.get()==v);
    BOOST_TEST(f2==f3);

#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
    Flyweight fr3;
    fr3=value_type(*it);
    BOOST_TEST(fr3.get()==value_type(*it));
#endif

    /* specialized algorithms */

    std::ostringstream oss1;
    oss1<<f1;
    std::istringstream iss1(oss1.str());
    Flyweight f5;
    iss1>>f5;
    BOOST_TEST(f5==f1);
  }
}
void FeedbackResponseTest::testShouldReturnCorrectAverageResponse() {
    FeedbackResponse fr1 ( 0, 5, 5, 0 );
    QVERIFY ( fr1.averageRounded() == 1 );

    FeedbackResponse fr2 ( 0, 5, 0, 0 );
    QVERIFY ( fr2.averageRounded() == 0 );

    FeedbackResponse fr3 ( 0, 0, 0, 5 );
    QVERIFY ( fr3.averageRounded() == 3 );

    FeedbackResponse fr4 ( 3, 2, 5, 11 );
    QVERIFY ( fr4.averageRounded() == 2 );
}
Пример #6
0
PyObject *_PY_fr1(PyObject *self, PyObject *args, PyObject *kwds)
   {int ok;
    PyObject *_lo;
    int _la1;
    bool _rv;
    char *kw_list[] = {"a1", NULL};

/* local variable initializations */
    _la1       = 0;

    ok = PyArg_ParseTupleAndKeywords(args, kwds,
                                     "i:fr1_p",
                                     kw_list,
                                     &_la1);
    if (ok == FALSE)
       return(NULL);

    _rv = fr1(_la1);
    _lo = PY_build_object("fr1",
                          G_BOOL_I, 0, &_rv,
                          0);

    return(_lo);}
// (6)に相当するテスト
void FractionTest::divide_fraction_by_0(void){
    Fraction fr1(6, 4);
    Fraction fr5(0, 2);
    CPPUNIT_ASSERT_THROW(fr1 / fr5, Fraction::DivisionByZeroException);
}
// (5)に相当するテスト
void FractionTest::divide_fractions(void){
    Fraction fr1(6, 4);
    Fraction fr3(2, 1);
    Fraction fr4(3, 4);
    CPPUNIT_ASSERT(fr4 == fr1 / fr3);
}