diff options
-rw-r--r-- | ext/wittle_generator/wittle_generator.cpp | 182 |
1 files changed, 180 insertions, 2 deletions
diff --git a/ext/wittle_generator/wittle_generator.cpp b/ext/wittle_generator/wittle_generator.cpp index 11bfffe..c2407cf 100644 --- a/ext/wittle_generator/wittle_generator.cpp +++ b/ext/wittle_generator/wittle_generator.cpp | |||
@@ -420,7 +420,7 @@ Rice::Object wittle_generator_generate_easy(Rice::Object /* self */) { | |||
420 | Rice::Object wittle_generator_generate_medium(Rice::Object /* self */) { | 420 | Rice::Object wittle_generator_generate_medium(Rice::Object /* self */) { |
421 | Generate generator; | 421 | Generate generator; |
422 | 422 | ||
423 | int choice = Random::rand() % 63; | 423 | int choice = Random::rand() % 66; |
424 | std::cout << "Generate MEDIUM: choice " << std::dec << choice << std::endl; | 424 | std::cout << "Generate MEDIUM: choice " << std::dec << choice << std::endl; |
425 | 425 | ||
426 | switch (choice) { | 426 | switch (choice) { |
@@ -990,6 +990,31 @@ Rice::Object wittle_generator_generate_medium(Rice::Object /* self */) { | |||
990 | {Decoration::Start, 3}}}); | 990 | {Decoration::Start, 3}}}); |
991 | break; | 991 | break; |
992 | } | 992 | } |
993 | case 63: { | ||
994 | generator.setFlag(Generate::TreehouseLayout); | ||
995 | generator.generate( | ||
996 | 4, 4, | ||
997 | {{{Decoration::Star | Decoration::Color::Orange, 1}, | ||
998 | {Decoration::Triangle | Decoration::Color::Orange, 7}}}); | ||
999 | break; | ||
1000 | } | ||
1001 | case 64: { | ||
1002 | generator.setFlag(Generate::TreehouseLayout); | ||
1003 | generator.generate( | ||
1004 | 4, 4, | ||
1005 | {{{Decoration::Star | Decoration::Color::Orange, 3}, | ||
1006 | {Decoration::Star | Decoration::Color::Magenta, 2}, | ||
1007 | {Decoration::Triangle | Decoration::Color::Orange, 2}, | ||
1008 | {Decoration::Triangle | Decoration::Color::Magenta, 2}}}); | ||
1009 | break; | ||
1010 | } | ||
1011 | case 65: { | ||
1012 | generator.setFlag(Generate::TreehouseLayout); | ||
1013 | generator.generate(4, 4, | ||
1014 | {{{Decoration::Star | Decoration::Color::Magenta, 4}, | ||
1015 | {Decoration::Dot_Intersection, 25}}}); | ||
1016 | break; | ||
1017 | } | ||
993 | } | 1018 | } |
994 | 1019 | ||
995 | Rice::String str(generator.AsCode()); | 1020 | Rice::String str(generator.AsCode()); |
@@ -999,7 +1024,7 @@ Rice::Object wittle_generator_generate_medium(Rice::Object /* self */) { | |||
999 | Rice::Object wittle_generator_generate_expert(Rice::Object /* self */) { | 1024 | Rice::Object wittle_generator_generate_expert(Rice::Object /* self */) { |
1000 | Generate generator; | 1025 | Generate generator; |
1001 | 1026 | ||
1002 | int choice = Random::rand() % 27; | 1027 | int choice = Random::rand() % 40; |
1003 | std::cout << "Generate EXPERT: choice " << std::dec << choice << std::endl; | 1028 | std::cout << "Generate EXPERT: choice " << std::dec << choice << std::endl; |
1004 | 1029 | ||
1005 | switch (choice) { | 1030 | switch (choice) { |
@@ -1319,6 +1344,159 @@ Rice::Object wittle_generator_generate_expert(Rice::Object /* self */) { | |||
1319 | {Decoration::Start, 1}}}); | 1344 | {Decoration::Start, 1}}}); |
1320 | break; | 1345 | break; |
1321 | } | 1346 | } |
1347 | case 27: { | ||
1348 | generator.setFlag(Generate::TreehouseLayout); | ||
1349 | generator.generate( | ||
1350 | 5, 5, | ||
1351 | {{{Decoration::Star | Decoration::Color::Orange, 4}, | ||
1352 | {Decoration::Triangle | Decoration::Color::Orange, 6}}}); | ||
1353 | break; | ||
1354 | } | ||
1355 | case 28: { | ||
1356 | generator.setFlag(Generate::TreehouseLayout); | ||
1357 | generator.generate( | ||
1358 | 5, 5, | ||
1359 | {{{Decoration::Star | Decoration::Color::Orange, 6}, | ||
1360 | {Decoration::Triangle | Decoration::Color::Orange, 5}}}); | ||
1361 | break; | ||
1362 | } | ||
1363 | case 29: { | ||
1364 | generator.setFlag(Generate::RegularStartEnd); | ||
1365 | generator.generate( | ||
1366 | 5, 5, | ||
1367 | {{{Decoration::Star | Decoration::Color::Orange, 5}, | ||
1368 | {Decoration::Triangle | Decoration::Color::Orange, 3}, | ||
1369 | {Decoration::Stone | Decoration::Color::Orange, 3}}}); | ||
1370 | break; | ||
1371 | } | ||
1372 | case 30: { | ||
1373 | generator.setFlag(Generate::TreehouseLayout); | ||
1374 | generator.generate( | ||
1375 | 5, 5, | ||
1376 | {{{Decoration::Poly | Decoration::Color::Orange, 3}, | ||
1377 | {Decoration::Poly | Decoration::Negative | Decoration::Color::Blue, | ||
1378 | 1}, | ||
1379 | {Decoration::Star | Decoration::Color::Orange, 5}, | ||
1380 | {Decoration::Star | Decoration::Color::Blue, 3}}}); | ||
1381 | break; | ||
1382 | } | ||
1383 | case 31: { | ||
1384 | generator.setFlag(Generate::TreehouseLayout); | ||
1385 | generator.generate( | ||
1386 | 5, 5, | ||
1387 | {{{Decoration::Poly | Decoration::Color::Orange, 3}, | ||
1388 | {Decoration::Poly | Decoration::Negative | Decoration::Color::Blue, | ||
1389 | 2}, | ||
1390 | {Decoration::Star | Decoration::Color::Orange, 5}, | ||
1391 | {Decoration::Star | Decoration::Color::Blue, 3}}}); | ||
1392 | break; | ||
1393 | } | ||
1394 | case 32: { | ||
1395 | generator.setFlag(Generate::TreehouseLayout); | ||
1396 | generator.generate( | ||
1397 | 5, 5, | ||
1398 | {{{Decoration::Poly | Decoration::Color::Orange, 1}, | ||
1399 | {Decoration::Poly | Decoration::Color::Magenta, 2}, | ||
1400 | {Decoration::Poly | Decoration::Negative | | ||
1401 | Decoration::Color::Orange, | ||
1402 | 2}, | ||
1403 | {Decoration::Poly | Decoration::Negative | Decoration::Color::Blue, | ||
1404 | 2}, | ||
1405 | {Decoration::Star | Decoration::Color::Orange, 3}, | ||
1406 | {Decoration::Star | Decoration::Color::Blue, 3}, | ||
1407 | {Decoration::Star | Decoration::Color::Magenta, 3}}}); | ||
1408 | break; | ||
1409 | } | ||
1410 | case 33: { | ||
1411 | generator.setFlag(Generate::TreehouseLayout); | ||
1412 | generator.generate( | ||
1413 | 5, 5, | ||
1414 | {{{Decoration::Poly | Decoration::Color::Magenta, 2}, | ||
1415 | {Decoration::Poly | Decoration::Negative | Decoration::Color::Blue, | ||
1416 | 2}, | ||
1417 | {Decoration::Star | Decoration::Color::Magenta, 3}, | ||
1418 | {Decoration::Star | Decoration::Color::Blue, 3}, | ||
1419 | {Decoration::Triangle | Decoration::Color::Magenta, 2}, | ||
1420 | {Decoration::Triangle | Decoration::Color::Blue, 2}}}); | ||
1421 | break; | ||
1422 | } | ||
1423 | case 34: { | ||
1424 | generator.setFlag(Generate::TreehouseLayout); | ||
1425 | generator.generate( | ||
1426 | 5, 5, | ||
1427 | {{{Decoration::Poly | Decoration::Color::Orange, 1}, | ||
1428 | {Decoration::Poly | Decoration::Color::Blue, 1}, | ||
1429 | {Decoration::Poly | Decoration::Color::Green, 1}, | ||
1430 | {Decoration::Poly | Decoration::Negative | Decoration::Color::Blue, | ||
1431 | 1}, | ||
1432 | {Decoration::Poly | Decoration::Negative | | ||
1433 | Decoration::Color::Magenta, | ||
1434 | 2}, | ||
1435 | {Decoration::Star | Decoration::Color::Green, 2}, | ||
1436 | {Decoration::Star | Decoration::Color::Magenta, 1}, | ||
1437 | {Decoration::Star | Decoration::Color::Orange, 1}, | ||
1438 | {Decoration::Star | Decoration::Color::Blue, 2}, | ||
1439 | {Decoration::Triangle | Decoration::Color::Magenta, 2}, | ||
1440 | {Decoration::Triangle | Decoration::Color::Orange, 1}, | ||
1441 | {Decoration::Triangle | Decoration::Color::Green, 2}}}); | ||
1442 | break; | ||
1443 | } | ||
1444 | case 35: { | ||
1445 | generator.setFlag(Generate::TreehouseLayout); | ||
1446 | generator.generate( | ||
1447 | 5, 5, | ||
1448 | {{{Decoration::Star | Decoration::Color::Orange, 4}, | ||
1449 | {Decoration::Star | Decoration::Color::Magenta, 4}, | ||
1450 | {Decoration::Triangle | Decoration::Color::Orange, 2}, | ||
1451 | {Decoration::Triangle | Decoration::Color::Magenta, 2}}}); | ||
1452 | break; | ||
1453 | } | ||
1454 | case 36: { | ||
1455 | generator.setFlag(Generate::TreehouseLayout); | ||
1456 | generator.generate( | ||
1457 | 5, 5, | ||
1458 | {{{Decoration::Star | Decoration::Color::Orange, 3}, | ||
1459 | {Decoration::Star | Decoration::Color::Magenta, 3}, | ||
1460 | {Decoration::Star | Decoration::Color::Green, 6}, | ||
1461 | {Decoration::Triangle | Decoration::Color::Orange, 2}, | ||
1462 | {Decoration::Triangle | Decoration::Color::Magenta, 2}}}); | ||
1463 | break; | ||
1464 | } | ||
1465 | case 37: { | ||
1466 | generator.setFlag(Generate::TreehouseLayout); | ||
1467 | generator.generate( | ||
1468 | 5, 5, | ||
1469 | {{{Decoration::Star | Decoration::Color::Orange, 4}, | ||
1470 | {Decoration::Star | Decoration::Color::Magenta, 4}, | ||
1471 | {Decoration::Star | Decoration::Color::Green, 6}, | ||
1472 | {Decoration::Triangle | Decoration::Color::Orange, 1}, | ||
1473 | {Decoration::Triangle | Decoration::Color::Magenta, 1}}}); | ||
1474 | break; | ||
1475 | } | ||
1476 | case 38: { | ||
1477 | generator.setFlag(Generate::TreehouseLayout); | ||
1478 | generator.generate( | ||
1479 | 5, 5, | ||
1480 | {{{Decoration::Star | Decoration::Color::Orange, 2}, | ||
1481 | {Decoration::Star | Decoration::Color::Magenta, 2}, | ||
1482 | {Decoration::Star | Decoration::Color::White, 2}, | ||
1483 | {Decoration::Star | Decoration::Color::Green, 2}, | ||
1484 | {Decoration::Star | Decoration::Color::Black, 2}, | ||
1485 | {Decoration::Triangle | Decoration::Color::Orange, 1}, | ||
1486 | {Decoration::Triangle | Decoration::Color::Magenta, 1}, | ||
1487 | {Decoration::Triangle | Decoration::Color::White, 1}, | ||
1488 | {Decoration::Triangle | Decoration::Color::Green, 1}, | ||
1489 | {Decoration::Triangle | Decoration::Color::Black, 1}}}); | ||
1490 | break; | ||
1491 | } | ||
1492 | case 39: { | ||
1493 | generator.setFlag(Generate::TreehouseLayout); | ||
1494 | generator.generate(5, 5, | ||
1495 | {{{Decoration::Star | Decoration::Color::Magenta, 4}, | ||
1496 | {Decoration::Star | Decoration::Color::Orange, 6}, | ||
1497 | {Decoration::Dot_Intersection, 36}}}); | ||
1498 | break; | ||
1499 | } | ||
1322 | } | 1500 | } |
1323 | 1501 | ||
1324 | Rice::String str(generator.AsCode()); | 1502 | Rice::String str(generator.AsCode()); |