Exemplo n.º 1
0
Arquivo: main.cpp Projeto: hdzz/Kapok
int main()
{
	std::array<std::string, 5> arr = { "a","b","c", "d", "e" };
	test_array(arr);

	std::vector<std::string> vt = { "a","b","c", "d", "e" };
	test_array(vt);

	int int_arr[5] = { 1,2,3,4,5 };
	test_array(int_arr);

	std::string str_arr[5] = { "a","b","c", "d", "e" };
	test_array(str_arr);

	std::queue<std::string> que_arr;
	que_arr.emplace("a");
	que_arr.emplace("b");
	test_array(que_arr);

	std::deque<std::string> deque_arr;
	deque_arr.push_back("a");
	deque_arr.push_back("b");
	test_array(deque_arr);

	std::priority_queue<std::string> priodeque_arr;
	priodeque_arr.push("a");
	priodeque_arr.push("b");
	test_array(priodeque_arr);

	std::set<std::string> set_arr;
	set_arr.emplace("a");
	set_arr.emplace("b");
	test_array(set_arr);
	std::multiset<std::string> multiset_arr;
	multiset_arr.emplace("a");
	multiset_arr.emplace("b");
	test_array(multiset_arr);
	std::unordered_set<std::string> unordset_arr;
	unordset_arr.emplace("a");
	unordset_arr.emplace("b");
	test_array(unordset_arr);

	std::stack<std::string> stack_arr;
	stack_arr.emplace("a");
	stack_arr.emplace("b");
	test_array(stack_arr);

	std::map<int, std::string> map = { {1, "a"},{2, "b"} };
	test_map(map);
	std::multimap<int, std::string> multimap = { { 1, "a" },{ 2, "b" } };
	test_map(multimap);
	std::unordered_map<int, std::string> unodermap = { { 1, "a" },{ 2, "b" } };
	test_map(unodermap);

	person p = { 20, "test" };
	test_object(p);

	return 0;
}
Exemplo n.º 2
0
int qhash(int argc, char* argv[])
{
  auto const model =
    QHash<QString, QString>{ { "name", "John Doe" }, { "age", "42" } };

  return test_map(model);
}
Exemplo n.º 3
0
int main (int argc, const char ** argv)
{
	//return test_animation("link.tmx");
	return test_map("Zelda.tmx");
	//return test_both("Zelda.tmx","link.tmx");
	return 1;
}
Exemplo n.º 4
0
int main() {

    test_map();
    test_vector();
    return 0;

}
Exemplo n.º 5
0
int main(int argc, char **argv)
{
	struct timeval t1, t2;

	if (argc != 3) {
		fprintf(stderr, "Usage: %s [--map|--btree] count\n", argv[0]);
		exit(1);
	}

	gettimeofday(&t1, NULL);
	if (std::string("--map") == argv[1]) {
		test_map(atoi(argv[2]));
	}
	else {
		test_btree(atoi(argv[2]));
	}

	gettimeofday(&t2, NULL);
	double ms = (t2.tv_sec - t1.tv_sec) / 1000.0 + (t2.tv_usec - t1.tv_usec) / 1000.0;
	fprintf(stderr, "insert into map, cost: %.3fms\n", ms);
	show_minfo();

	sleep(30);
	return 0;
}
Exemplo n.º 6
0
int main()
{    
    test_map();
    test_finda();
    printf("ok\n");
    return 0;
}
Exemplo n.º 7
0
int test_main( int /* argc */, char* /* argv */[] )
{
    test_map();
    test_map_2();
    test_multimap();
    
    return EXIT_SUCCESS;
}
Exemplo n.º 8
0
int main(int argc, char **argv) {
    test_string();
    test_list();
    test_map();
    test_map_stack();
    test_dict();
    printf("Passed\n");
    return 0;
}
Exemplo n.º 9
0
int test_main( int /* argc */, char* /* argv */[] )
{
    test_map();
    test_map_2();
    test_multimap();
    #ifdef BOOST_HAS_HASH
    test_hash_map();
    test_hash_multimap();
    #endif
    return EXIT_SUCCESS;
}
Exemplo n.º 10
0
/*===========================================================================*
 *			       sef_cb_init_fresh			     *
 *===========================================================================*/
static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
{
	/* Run all the tests. */
	test_u32();
	test_str();
	test_mem();
	test_map();
	test_label();

	return OK;
}
Exemplo n.º 11
0
static int
test_maps(void)
{
	plan(54);
	header();

	test_map(0, "\x80", 1);
	test_map(1, "\x81", 1);
	test_map(15, "\x8f", 1);
	test_map(16, "\xde\x00\x10", 3);
	test_map(UINT16_MAX - 1, "\xde\xff\xfe", 3);
	test_map(UINT16_MAX, "\xde\xff\xff", 3);
	test_map(UINT16_MAX + 1, "\xdf\x00\x01\x00\x00", 5);
	test_map(UINT32_MAX - 1, "\xdf\xff\xff\xff\xfe", 5);
	test_map(UINT32_MAX, "\xdf\xff\xff\xff\xff", 5);

	footer();
	return check_plan();
}
Exemplo n.º 12
0
static int
test_maps(void)
{
	plan(54);
	header();

	test_map(0, "\x80", 1);
	test_map(1, "\x81", 1);
	test_map(15, "\x8f", 1);
	test_map(16, "\xde\x00\x10", 3);
	test_map(0xfffe, "\xde\xff\xfe", 3);
	test_map(0xffff, "\xde\xff\xff", 3);
	test_map(0x10000, "\xdf\x00\x01\x00\x00", 5);
	test_map(0xfffffffeU, "\xdf\xff\xff\xff\xfe", 5);
	test_map(0xffffffffU, "\xdf\xff\xff\xff\xff", 5);

	footer();
	return check_plan();
}
Exemplo n.º 13
0
/*===========================================================================*
 *				main					     *
 *===========================================================================*/
int main(void)
{
	/* SEF local startup. */
	sef_local_startup();

	/* Run all the tests. */
	test_u32();
	test_str();
	test_mem();
	test_map();
	test_label();

	return 0;
}
Exemplo n.º 14
0
int main(int argc, char **argv) {
        unsigned int i;

        /* we want stable tests, so use fixed seed */
        srand(0xdeadbeef);

        test_api();

        /*
         * The tests are pseudo random; run them multiple times, each run will
         * have different orders and thus different results.
         */
        for (i = 0; i < 4; ++i) {
                test_shuffle();
                test_map();
        }

        return 0;
}
Exemplo n.º 15
0
int main (int , char **)
{
  test_vector ();
  test_map ();
  test_integer_vector ();
  test_double_vector ();
  test_string_vector ();
  test_integer ();
  test_double ();
  test_map_exchanges ();
  test_vector_exchanges ();
  test_native_vectors ();
  test_queue ();
  
  test_vector_transfer ();
  test_flex_map ();

  test_collection ();

  return 0;
}
Exemplo n.º 16
0
int
main(int argc, char *argv[])
{
	START(argc, argv, "obj_cpp_map");

	if (argc != 3 || strchr("co", argv[1][0]) == nullptr)
		UT_FATAL("usage: %s <c,o> file-name", argv[0]);

	const char *path = argv[2];

	nvobj::pool<root> pop;
	bool open = (argv[1][0] == 'o');

	try {
		if (open) {
			pop = nvobj::pool<root>::open(path, LAYOUT);

		} else {
			pop = nvobj::pool<root>::create(path, LAYOUT,
							PMEMOBJ_MIN_POOL * 2,
							S_IWUSR | S_IRUSR);
			nvobj::transaction::manual tx(pop);
			pop.get_root()->cons =
				nvobj::make_persistent<containers>(pop);
			nvobj::transaction::commit();
		}
	} catch (nvml::pool_error &pe) {
		UT_FATAL("!pool::create: %s %s", pe.what(), path);
	}

	test_map(pop, open);

	pop.close();

	DONE(nullptr);
}
Exemplo n.º 17
0
static void test44() {
    SkMatrix44 m0, m1, m2;

    test_inv("identity", m0);
    m0.setTranslate(2,3,4);
    test_inv("translate", m0);
    m0.setScale(2,3,4);
    test_inv("scale", m0);
    m0.postTranslate(5, 6, 7);
    test_inv("postTranslate", m0);
    m0.setScale(2,3,4);
    m1.setTranslate(5, 6, 7);
    m0.setConcat(m0, m1);
    test_inv("postTranslate2", m0);
    m0.setScale(2,3,4);
    m0.preTranslate(5, 6, 7);
    test_inv("preTranslate", m0);
    
    m0.setScale(2, 4, 6);
    m0.postScale(SkDoubleToMScalar(0.5));
    test_inv("scale/postscale to 1,2,3", m0);

    m0.reset();
    test_map(1, 0, 0, m0, 1, 0, 0);
    test_map(0, 1, 0, m0, 0, 1, 0);
    test_map(0, 0, 1, m0, 0, 0, 1);
    m0.setScale(2, 3, 4);
    test_map(1, 0, 0, m0, 2, 0, 0);
    test_map(0, 1, 0, m0, 0, 3, 0);
    test_map(0, 0, 1, m0, 0, 0, 4);
    m0.setTranslate(2, 3, 4);
    test_map(0, 0, 0, m0, 2, 3, 4);
    m0.preScale(5, 6, 7);
    test_map(1, 0, 0, m0, 7, 3, 4);
    test_map(0, 1, 0, m0, 2, 9, 4);
    test_map(0, 0, 1, m0, 2, 3, 11);

    SkMScalar deg = 45;
    m0.setRotateDegreesAbout(0, 0, 1, deg);
    test_map(1, 0, 0, m0, 0.707106769, -0.707106769, 0);

    m0.reset();
    test_33(m0, 1, 0, 0, 0, 1, 0);
    m0.setTranslate(3, 4, 5);
    test_33(m0, 1, 0, 3, 0, 1, 4);
}
Exemplo n.º 18
0
int _STLP_CALL main(int argc, char** argv)
{
#if defined(_WIN32_WCE)  || defined(__SYMBIAN32__)
  std::ofstream file( "c:\\eh_test.txt" );
  std::streambuf* old_cout_buf = cout.rdbuf(file.rdbuf());
  std::streambuf* old_cerr_buf = cerr.rdbuf(file.rdbuf());
#endif
#if defined( __MWERKS__ ) && defined( macintosh )  // Get command line.
  argc = ccommand(&argv);
  // Allow the i/o window to be repositioned.
//  EH_STD::string s;
//  getline(EH_STD::cin, s);
#endif
    unsigned int niters=2;
    bool run_all=true;
    bool run_slist = false;
    bool run_list = false;
    bool run_vector = false;
    bool run_bit_vector = false;
    bool run_deque = false;
    bool run_hash_map = false;
    bool run_hash_set = false;
    bool run_set = false;
    bool run_map = false;
    bool run_algo = false;
    bool run_algobase = false;
    bool run_rope = false;
    bool run_string = false;
    bool run_bitset = false;
    bool run_valarray = false;

    int cur_argv;
    char *p, *p1;
#if defined (EH_NEW_IOSTREAMS)
    std::ios_base::sync_with_stdio(false);
#endif

    cerr << argv[0]<<" : Exception handling testsuite.\n";
    cerr.flush();

  bool track_allocations = false;
    // parse parameters :
    // leak_test [-iterations] [-test] ...
    for (cur_argv=1; cur_argv<argc; cur_argv++) {
        p = argv[cur_argv];
        if (*p == '-') {
            switch (p[1]) {
            case 'q':
                gTestController.SetVerbose(false);
                break;
            case 'v':
                gTestController.SetVerbose(true);
                break;
#if 0  // This option was never actually used -- dwa 9/22/97
            case 'i':
                gTestController.IgnoreLeaks(true);
                break;
#endif
            case 'n':
                p1 = argv[++cur_argv];
                if (p1 && EH_CSTD::sscanf(p1, "%i", &niters)==1)
                    cerr <<" Doing "<<niters<<" iterations\n";
                else
                    usage(argv[0]);
                break;
            case 't':
              track_allocations = true;
              break;
            case 'e':
                gTestController.TurnOffExceptions();
                break;
            case 's':
                p1 = argv[++cur_argv];
                if (p1 && EH_CSTD::sscanf(p1, "%i", &random_base)==1)
                    cerr <<" Setting  "<<random_base<<" as base for random sizes.\n";
                else
                    usage(argv[0]);
                break;
            default:
                usage(argv[0]);
                break;
            }
        } else {
            run_all = false;
            // test name
            if (EH_CSTD::strcmp(p, "algo")==0) {
                run_algo=true;
            } else if (EH_CSTD::strcmp(p, "vector")==0) {
                run_vector=true;
            } else if (EH_CSTD::strcmp(p, "bit_vector")==0) {
                run_bit_vector=true;
            } else if (EH_CSTD::strcmp(p, "list")==0) {
                run_list=true;
            } else if (EH_CSTD::strcmp(p, "slist")==0) {
                run_slist=true;
            } else if (EH_CSTD::strcmp(p, "deque")==0) {
                run_deque=true;
            } else if (EH_CSTD::strcmp(p, "set")==0) {
                run_set=true;
            } else if (EH_CSTD::strcmp(p, "map")==0) {
                run_map=true;
            } else if (EH_CSTD::strcmp(p, "hash_set")==0) {
                run_hash_set=true;
            } else if (EH_CSTD::strcmp(p, "hash_map")==0) {
                run_hash_map=true;
            } else if (EH_CSTD::strcmp(p, "rope")==0) {
                run_rope=true;
            } else if (EH_CSTD::strcmp(p, "string")==0) {
                run_string=true;
            } else if (EH_CSTD::strcmp(p, "bitset")==0) {
                run_bitset=true;
            } else if (EH_CSTD::strcmp(p, "valarray")==0) {
                run_valarray=true;
            } else {
                usage(argv[0]);
            }

        }
    }

  gTestController.TrackAllocations( track_allocations );

    // Over and over...
    for ( unsigned i = 0; i < niters ; i++ )
    {
     cerr << "iteration #" << i << "\n";
        if (run_all || run_algobase) {
            gTestController.SetCurrentContainer("algobase");
            cerr << "EH test : algobase" << endl;
            test_algobase();
        }
        if (run_all || run_algo) {
            gTestController.SetCurrentContainer("algo");
            cerr << "EH test : algo" << endl;
            test_algo();
        }

        if (run_all || run_vector) {
            gTestController.SetCurrentContainer("vector");
            cerr << "EH test : vector" << endl;
            test_vector();
        }

#if defined( EH_BIT_VECTOR_IMPLEMENTED )
        if (run_all || run_bit_vector) {
            gTestController.SetCurrentContainer("bit_vector");
           cerr << "EH test : bit_vector" << endl;
            test_bit_vector();
        }
#endif

        if (run_all || run_list) {
            gTestController.SetCurrentContainer("list");
            cerr << "EH test : list" << endl;
            test_list();
        }

#if defined( EH_SLIST_IMPLEMENTED )
        if (run_all || run_slist) {
            gTestController.SetCurrentContainer("slist");
            cerr << "EH test : slist" << endl;
            test_slist();
        }
#endif // EH_SLIST_IMPLEMENTED

        if (run_all || run_deque) {
            gTestController.SetCurrentContainer("deque");
            cerr << "EH test : deque" << endl;
            test_deque();
        }
        if (run_all || run_set) {
            gTestController.SetCurrentContainer("set");
            cerr << "EH test : set" << endl;
            test_set();
            gTestController.SetCurrentContainer("multiset");
            cerr << "EH test : multiset" << endl;
            test_multiset();
        }

        if (run_all || run_map) {
            gTestController.SetCurrentContainer("map");
            cerr << "EH test : map" << endl;
            test_map();
            gTestController.SetCurrentContainer("multimap");
            cerr << "EH test : multimap" << endl;
            test_multimap();
        }

#if defined( EH_HASHED_CONTAINERS_IMPLEMENTED )
        if (run_all || run_hash_map) {
            gTestController.SetCurrentContainer("hash_map");
            cerr << "EH test : hash_map" << endl;
            test_hash_map();
            gTestController.SetCurrentContainer("hash_multimap");
            cerr << "EH test : hash_multimap" << endl;
            
            test_hash_multimap();
        }

        if (run_all || run_hash_set) {
            gTestController.SetCurrentContainer("hash_set");
            cerr << "EH test : hash_set" << endl;
            test_hash_set();
            gTestController.SetCurrentContainer("hash_multiset");
            cerr << "EH test : hash_multiset" << endl;
            test_hash_multiset();
        }
#endif // EH_HASHED_CONTAINERS_IMPLEMENTED

#if defined( EH_ROPE_IMPLEMENTED )
  // CW1.8 can't compile this for some reason!
#if !( defined(__MWERKS__) && __MWERKS__ < 0x1900 )
        if (run_all || run_rope) {
            gTestController.SetCurrentContainer("rope");
            cerr << "EH test : rope" << endl;
            test_rope();
        }
#endif
#endif // EH_ROPE_IMPLEMENTED
#if defined( EH_STRING_IMPLEMENTED )
        if (run_all || run_string) {
            gTestController.SetCurrentContainer("string");
            cerr << "EH test : string" << endl;
            test_string();
        }
#endif
#if defined( EH_BITSET_IMPLEMENTED )
        if (run_all || run_bitset) {
            gTestController.SetCurrentContainer("bitset");
            cerr << "EH test : bitset" << endl;
            test_bitset();
        }
#endif
#if defined( EH_VALARRAY_IMPLEMENTED )
        if (run_all || run_bitset) {
            gTestController.SetCurrentContainer("valarray");
            cerr << "EH test : valarray" << endl;
            test_valarray();
        }
#endif
    }

  gTestController.TrackAllocations( false );
    cerr << "EH test : Done\n";

#if defined(_WIN32_WCE) || defined(__SYMBIAN32__)
   cout.rdbuf(old_cout_buf);
   cerr.rdbuf(old_cerr_buf);
   file.close();
#endif

    return 0;
}
Exemplo n.º 19
0
int main(int argc, char **argv)
{
  for (size_t i = 0; i < 128; i++) {
    test_class(PN_OBJECT, i);
    test_class(PN_VOID, i);
    test_class(&noop_class, i);
  }

  for (size_t i = 0; i < 128; i++) {
    test_new(i, PN_OBJECT);
    test_new(i, &noop_class);
  }

  test_finalize();
  test_free();
  test_hashcode();
  test_compare();

  for (int i = 0; i < 1024; i++) {
    test_refcounting(i);
  }

  for (size_t i = 0; i < 4; i++) {
    test_list(i);
  }

  for (size_t i = 0; i < 4; i++) {
    test_list_refcount(i);
  }

  test_list_index();

  test_map();
  test_map_links();

  test_hash();

  test_string(NULL);
  test_string("");
  test_string("this is a test");
  test_string("012345678910111213151617181920212223242526272829303132333435363"
              "738394041424344454647484950515253545556575859606162636465666768");
  test_string("this has an embedded \000 in it");
  test_stringn("this has an embedded \000 in it", 28);

  test_string_format();
  test_string_addf();

  test_build_list();
  test_build_map();
  test_build_map_odd();

  for (int i = 0; i < 64; i++)
  {
    test_map_iteration(i);
  }

  test_list_inspect();
  test_map_inspect();
  test_list_compare();
  test_iterator();
  for (int seed = 0; seed < 64; seed++) {
    for (int size = 1; size <= 64; size++) {
      test_heap(seed, size);
    }
  }

  return 0;
}
Exemplo n.º 20
0
int main() {
	test_multimap();
	test_map();
	return 0;
}
Exemplo n.º 21
0
int Test::all() {

	clock_t begin = clock();
	exeTime = 0;

	test_general();
	test_types();
	test_booleans();
	test_numbers();
	test_strings();
	test_arrays();
	test_intervals();
	test_map();
	test_set();
	test_objects();
	test_functions();
	test_classes();
	test_loops();
	test_operators();
	test_references();
	test_exceptions();
	test_operations();
	test_system();
	test_json();
	test_files();
	test_doc();
	test_utils();

	double elapsed_secs = double(clock() - begin) / CLOCKS_PER_SEC;
	int errors = (total - success_count);
	int leaks = (obj_created - obj_deleted);
	int mpz_leaks = (mpz_obj_created - mpz_obj_deleted);

	std::ostringstream line1, line2, line3, line4;
	line1 << "Total : " << total << ", success : " << success_count << ", errors : " << errors;
	line2 << "Total time : " << elapsed_secs * 1000 << " ms";
	line3 << "Objects destroyed : " << obj_deleted << " / " << obj_created << " (" << leaks << " leaked)";
	line4 << "MPZ objects destroyed : " << mpz_obj_deleted << " / " << mpz_obj_created << " (" << mpz_leaks << " leaked)";
	unsigned w = std::max(line1.str().size(), std::max(line2.str().size(), std::max(line3.str().size(), line4.str().size())));

	auto pad = [](std::string s, int l) {
		l -= s.size();
		while (l-- > 0) s += " ";
		return s;
	};
	std::cout << "┌";
	for (unsigned i = 0; i < w + 2; ++i) std::cout << "─";
	std::cout << "┐" << std::endl;
	std::cout << "│ " << pad(line1.str(), w) << " │" << std::endl;
	std::cout << "│ " << pad(line2.str(), w) << " │" << std::endl;
	std::cout << "│ " << pad(line3.str(), w) << " │" << std::endl;
	std::cout << "│ " << pad(line4.str(), w) << " │" << std::endl;
	std::cout << "├";
	for (unsigned i = 0; i < w + 2; ++i) std::cout << "─";
	std::cout << "┤";
	std::cout << std::endl;

	int result = abs(errors) + abs(leaks) + abs(mpz_leaks);
	if (result == 0) {
		std::cout << "│ " << pad("GOOD! ✔", w + 2) << " │" << std::endl;
	} else {
		std::cout << "│ " << pad("BAD! : " + std::to_string(result) + " error(s) ✘", w + 2) << " │" << std::endl;
	}
	std::cout << "└";
	for (unsigned i = 0; i < w + 2; ++i) std::cout << "─";
	std::cout << "┘" << std::endl;

	for (const auto& error : failed_tests) {
		std::cout << " " << error << std::endl;
	}
	if (failed_tests.size()) {
		std::cout << std::endl;
	}
	return result;
}
Exemplo n.º 22
0
void process_keys() {
	if (game.cooldown <= 0) {
		scanKeys();
		u32 keys = keysHeld();
		u32 down = keysDown();
		touchPosition touch = touchReadXY();

		if (down & KEY_START) {
			new_game();
			return;
		}

		if (down & KEY_SELECT) {
			test_map();

			torch.buf.scroll.x = game.player.x - 16;
			torch.buf.scroll.y = game.player.y - 12;
			torch.buf.bounded(torch.buf.scroll.x, torch.buf.scroll.y);
			torch.dirty_screen();
			torch.reset_luminance();

			return;
		}

		if (down & KEY_X) {
			inventory(); return;
		}
		if (down & KEY_L) {
			overview(); return;
		}

		if (down & KEY_TOUCH && touch.px != 0 && touch.py != 0) {
			if (!(keys & KEY_R) && game.player.projectile) {
				game.player.chuck(torch.buf.scroll.x + touch.px/8,
													torch.buf.scroll.y + touch.py/8);
			}
			return;
		}

		if (down & KEY_R) {
			printf("Saving... ");
			fflush(stdout);
			game.save("blah.adrift");
			printf("done\n");
			printf("Loading... ");
			fflush(stdout);
			game.load("blah.adrift");
			printf("done\n");
		}

		if (keys & KEY_Y) {
			if (get_items()) return;
		}

		DIRECTION dir = 0;
		if (keys & KEY_RIGHT)
			dir |= D_EAST;
		else if (keys & KEY_LEFT)
			dir |= D_WEST;
		if (keys & KEY_DOWN)
			dir |= D_SOUTH;
		else if (keys & KEY_UP)
			dir |= D_NORTH;

		if (dir) {
			game.player.moveDir(dir, keys & KEY_B);
			return;
		}

		if (down & KEY_A) {
			seek_and_destroy();
			if (!game.player.target) {
				// no monsters in range
				for (int x = game.player.x-1; x <= game.player.x+1; x++) {
					for (int y = game.player.y-1; y <= game.player.y+1; y++) {
						Object *o = game.map.at(x,y)->objects.head();
						if (!o) continue;
						if (o->type == VENDING_MACHINE) {
							if (game.player.x == x+D_DX[o->orientation] && game.player.y == y+D_DY[o->orientation]) {
								iprintf("You kick the vending machine. ");
								if (o->quantity > 0 && rand4() < 5) {
									if (rand4() & 1) {
										iprintf("Clunk! A can rolls out.\n");
										addObject(game.player.x, game.player.y, CAN_OF_STEWED_BEEF);
									} else {
										iprintf("Clunk! A bottle rolls out.\n");
										addObject(game.player.x, game.player.y, BOTTLE_OF_WATER);
									}
									o->quantity--;
								} else {
									iprintf("Nothing happens.\n");
								}
								game.cooldown += 5;
							}
						}
					}
				}
			} else return;
		}
		if (keys & KEY_A) {
			seek_and_destroy(); return;
		}

	} else if (game.cooldown > 0)
		game.cooldown--;
}