diff options
Diffstat (limited to 'apps/recorder/wormlet.c')
-rw-r--r-- | apps/recorder/wormlet.c | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/apps/recorder/wormlet.c b/apps/recorder/wormlet.c index 0edd550966..5fb48aa48e 100644 --- a/apps/recorder/wormlet.c +++ b/apps/recorder/wormlet.c | |||
@@ -1213,8 +1213,8 @@ static void score_board(void) | |||
1213 | snprintf(buf2, sizeof(buf2), str(LANG_WORMLET_CRASHED)); | 1213 | snprintf(buf2, sizeof(buf2), str(LANG_WORMLET_CRASHED)); |
1214 | break; | 1214 | break; |
1215 | } | 1215 | } |
1216 | lcd_putsxy(FIELD_RECT_WIDTH + 3, y , buf, 0); | 1216 | lcd_putsxy(FIELD_RECT_WIDTH + 3, y , buf); |
1217 | lcd_putsxy(FIELD_RECT_WIDTH + 3, y+8, buf2, 0); | 1217 | lcd_putsxy(FIELD_RECT_WIDTH + 3, y+8, buf2); |
1218 | 1218 | ||
1219 | if (!worms[i].alive){ | 1219 | if (!worms[i].alive){ |
1220 | lcd_invertrect(FIELD_RECT_WIDTH + 2, y, | 1220 | lcd_invertrect(FIELD_RECT_WIDTH + 2, y, |
@@ -1224,9 +1224,9 @@ static void score_board(void) | |||
1224 | } | 1224 | } |
1225 | snprintf(buf , sizeof(buf), str(LANG_WORMLET_HIGHSCORE), highscore); | 1225 | snprintf(buf , sizeof(buf), str(LANG_WORMLET_HIGHSCORE), highscore); |
1226 | #ifndef DEBUG_WORMLET | 1226 | #ifndef DEBUG_WORMLET |
1227 | lcd_putsxy(FIELD_RECT_WIDTH + 3, LCD_HEIGHT - 8, buf, 0); | 1227 | lcd_putsxy(FIELD_RECT_WIDTH + 3, LCD_HEIGHT - 8, buf); |
1228 | #else | 1228 | #else |
1229 | lcd_putsxy(FIELD_RECT_WIDTH + 3, LCD_HEIGHT - 8, debugout, 0); | 1229 | lcd_putsxy(FIELD_RECT_WIDTH + 3, LCD_HEIGHT - 8, debugout); |
1230 | #endif | 1230 | #endif |
1231 | } | 1231 | } |
1232 | 1232 | ||
@@ -1451,7 +1451,7 @@ static void test_worm_food_collision(void) { | |||
1451 | collision_count++; | 1451 | collision_count++; |
1452 | } | 1452 | } |
1453 | snprintf(buf, sizeof buf, "collisions: %d", collision_count); | 1453 | snprintf(buf, sizeof buf, "collisions: %d", collision_count); |
1454 | lcd_putsxy(0, LCD_HEIGHT -8, buf, 0); | 1454 | lcd_putsxy(0, LCD_HEIGHT -8, buf); |
1455 | lcd_update(); | 1455 | lcd_update(); |
1456 | } | 1456 | } |
1457 | if (collision_count != FOOD_SIZE) { | 1457 | if (collision_count != FOOD_SIZE) { |
@@ -1470,7 +1470,7 @@ static void test_worm_food_collision(void) { | |||
1470 | collision_count ++; | 1470 | collision_count ++; |
1471 | } | 1471 | } |
1472 | snprintf(buf, sizeof buf, "collisions: %d", collision_count); | 1472 | snprintf(buf, sizeof buf, "collisions: %d", collision_count); |
1473 | lcd_putsxy(0, LCD_HEIGHT -8, buf, 0); | 1473 | lcd_putsxy(0, LCD_HEIGHT -8, buf); |
1474 | lcd_update(); | 1474 | lcd_update(); |
1475 | } | 1475 | } |
1476 | if (collision_count != FOOD_SIZE * 2) { | 1476 | if (collision_count != FOOD_SIZE * 2) { |
@@ -1518,7 +1518,7 @@ static void test_worm_argh_collision(void) { | |||
1518 | collision_count ++; | 1518 | collision_count ++; |
1519 | } | 1519 | } |
1520 | snprintf(buf, sizeof buf, "collisions: %d", collision_count); | 1520 | snprintf(buf, sizeof buf, "collisions: %d", collision_count); |
1521 | lcd_putsxy(0, LCD_HEIGHT -8, buf, 0); | 1521 | lcd_putsxy(0, LCD_HEIGHT -8, buf); |
1522 | lcd_update(); | 1522 | lcd_update(); |
1523 | } | 1523 | } |
1524 | if (collision_count != ARGH_SIZE * 2) { | 1524 | if (collision_count != ARGH_SIZE * 2) { |
@@ -1535,7 +1535,7 @@ static void test_worm_argh_collision(void) { | |||
1535 | collision_count ++; | 1535 | collision_count ++; |
1536 | } | 1536 | } |
1537 | snprintf(buf, sizeof buf, "collisions: %d", collision_count); | 1537 | snprintf(buf, sizeof buf, "collisions: %d", collision_count); |
1538 | lcd_putsxy(0, LCD_HEIGHT -8, buf, 0); | 1538 | lcd_putsxy(0, LCD_HEIGHT -8, buf); |
1539 | lcd_update(); | 1539 | lcd_update(); |
1540 | } | 1540 | } |
1541 | if (collision_count != ARGH_SIZE * 4) { | 1541 | if (collision_count != ARGH_SIZE * 4) { |
@@ -1562,7 +1562,7 @@ static int testline_in_rect(void) { | |||
1562 | lcd_drawrect(rx, ry, rw, rh); | 1562 | lcd_drawrect(rx, ry, rw, rh); |
1563 | lcd_drawline(x1, y1, x2, y2); | 1563 | lcd_drawline(x1, y1, x2, y2); |
1564 | lcd_update(); | 1564 | lcd_update(); |
1565 | lcd_putsxy(0, 0, "failed 1", 0); | 1565 | lcd_putsxy(0, 0, "failed 1"); |
1566 | button_get(true); | 1566 | button_get(true); |
1567 | testfailed = 1; | 1567 | testfailed = 1; |
1568 | } | 1568 | } |
@@ -1573,7 +1573,7 @@ static int testline_in_rect(void) { | |||
1573 | !line_in_rect(x2, y2, x1, y1, rx, ry, rw, rh)) { | 1573 | !line_in_rect(x2, y2, x1, y1, rx, ry, rw, rh)) { |
1574 | lcd_drawrect(rx, ry, rw, rh); | 1574 | lcd_drawrect(rx, ry, rw, rh); |
1575 | lcd_drawline(x1, y1, x2, y2); | 1575 | lcd_drawline(x1, y1, x2, y2); |
1576 | lcd_putsxy(0, 0, "failed 2", 0); | 1576 | lcd_putsxy(0, 0, "failed 2"); |
1577 | lcd_update(); | 1577 | lcd_update(); |
1578 | button_get(true); | 1578 | button_get(true); |
1579 | testfailed = 2; | 1579 | testfailed = 2; |
@@ -1585,7 +1585,7 @@ static int testline_in_rect(void) { | |||
1585 | !line_in_rect(x2, y2, x1, y1, rx, ry, rw, rh)) { | 1585 | !line_in_rect(x2, y2, x1, y1, rx, ry, rw, rh)) { |
1586 | lcd_drawrect(rx, ry, rw, rh); | 1586 | lcd_drawrect(rx, ry, rw, rh); |
1587 | lcd_drawline(x1, y1, x2, y2); | 1587 | lcd_drawline(x1, y1, x2, y2); |
1588 | lcd_putsxy(0, 0, "failed 3", 0); | 1588 | lcd_putsxy(0, 0, "failed 3"); |
1589 | lcd_update(); | 1589 | lcd_update(); |
1590 | button_get(true); | 1590 | button_get(true); |
1591 | testfailed = 3; | 1591 | testfailed = 3; |
@@ -1597,7 +1597,7 @@ static int testline_in_rect(void) { | |||
1597 | !line_in_rect(x2, y2, x1, y1, rx, ry, rw, rh)) { | 1597 | !line_in_rect(x2, y2, x1, y1, rx, ry, rw, rh)) { |
1598 | lcd_drawrect(rx, ry, rw, rh); | 1598 | lcd_drawrect(rx, ry, rw, rh); |
1599 | lcd_drawline(x1, y1, x2, y2); | 1599 | lcd_drawline(x1, y1, x2, y2); |
1600 | lcd_putsxy(0, 0, "failed 4", 0); | 1600 | lcd_putsxy(0, 0, "failed 4"); |
1601 | lcd_update(); | 1601 | lcd_update(); |
1602 | button_get(true); | 1602 | button_get(true); |
1603 | testfailed = 4; | 1603 | testfailed = 4; |
@@ -1609,7 +1609,7 @@ static int testline_in_rect(void) { | |||
1609 | line_in_rect(x2, y2, x1, y1, rx, ry, rw, rh)) { | 1609 | line_in_rect(x2, y2, x1, y1, rx, ry, rw, rh)) { |
1610 | lcd_drawrect(rx, ry, rw, rh); | 1610 | lcd_drawrect(rx, ry, rw, rh); |
1611 | lcd_drawline(x1, y1, x2, y2); | 1611 | lcd_drawline(x1, y1, x2, y2); |
1612 | lcd_putsxy(0, 0, "failed 5", 0); | 1612 | lcd_putsxy(0, 0, "failed 5"); |
1613 | lcd_update(); | 1613 | lcd_update(); |
1614 | button_get(true); | 1614 | button_get(true); |
1615 | testfailed = 5; | 1615 | testfailed = 5; |
@@ -1622,7 +1622,7 @@ static int testline_in_rect(void) { | |||
1622 | line_in_rect(x2, y2, x1, y1, rx, ry, rw, rh)) { | 1622 | line_in_rect(x2, y2, x1, y1, rx, ry, rw, rh)) { |
1623 | lcd_drawrect(rx, ry, rw, rh); | 1623 | lcd_drawrect(rx, ry, rw, rh); |
1624 | lcd_drawline(x1, y1, x2, y2); | 1624 | lcd_drawline(x1, y1, x2, y2); |
1625 | lcd_putsxy(0, 0, "failed 6", 0); | 1625 | lcd_putsxy(0, 0, "failed 6"); |
1626 | lcd_update(); | 1626 | lcd_update(); |
1627 | button_get(true); | 1627 | button_get(true); |
1628 | testfailed = 6; | 1628 | testfailed = 6; |
@@ -1637,7 +1637,7 @@ static int testline_in_rect(void) { | |||
1637 | !line_in_rect(x2, y2, x1, y1, rx, ry, rw, rh)) { | 1637 | !line_in_rect(x2, y2, x1, y1, rx, ry, rw, rh)) { |
1638 | lcd_drawrect(rx, ry, rw, rh); | 1638 | lcd_drawrect(rx, ry, rw, rh); |
1639 | lcd_drawline(x1, y1, x2, y2); | 1639 | lcd_drawline(x1, y1, x2, y2); |
1640 | lcd_putsxy(0, 0, "failed 7", 0); | 1640 | lcd_putsxy(0, 0, "failed 7"); |
1641 | lcd_update(); | 1641 | lcd_update(); |
1642 | button_get(true); | 1642 | button_get(true); |
1643 | testfailed = 7; | 1643 | testfailed = 7; |
@@ -1649,7 +1649,7 @@ static int testline_in_rect(void) { | |||
1649 | !line_in_rect(x2, y2, x1, y1, rx, ry, rw, rh)) { | 1649 | !line_in_rect(x2, y2, x1, y1, rx, ry, rw, rh)) { |
1650 | lcd_drawrect(rx, ry, rw, rh); | 1650 | lcd_drawrect(rx, ry, rw, rh); |
1651 | lcd_drawline(x1, y1, x2, y2); | 1651 | lcd_drawline(x1, y1, x2, y2); |
1652 | lcd_putsxy(0, 0, "failed 8", 0); | 1652 | lcd_putsxy(0, 0, "failed 8"); |
1653 | lcd_update(); | 1653 | lcd_update(); |
1654 | button_get(true); | 1654 | button_get(true); |
1655 | testfailed = 8; | 1655 | testfailed = 8; |
@@ -1661,7 +1661,7 @@ static int testline_in_rect(void) { | |||
1661 | !line_in_rect(x2, y2, x1, y1, rx, ry, rw, rh)) { | 1661 | !line_in_rect(x2, y2, x1, y1, rx, ry, rw, rh)) { |
1662 | lcd_drawrect(rx, ry, rw, rh); | 1662 | lcd_drawrect(rx, ry, rw, rh); |
1663 | lcd_drawline(x1, y1, x2, y2); | 1663 | lcd_drawline(x1, y1, x2, y2); |
1664 | lcd_putsxy(0, 0, "failed 9", 0); | 1664 | lcd_putsxy(0, 0, "failed 9"); |
1665 | lcd_update(); | 1665 | lcd_update(); |
1666 | button_get(true); | 1666 | button_get(true); |
1667 | testfailed = 9; | 1667 | testfailed = 9; |
@@ -1673,7 +1673,7 @@ static int testline_in_rect(void) { | |||
1673 | !line_in_rect(x2, y2, x1, y1, rx, ry, rw, rh)) { | 1673 | !line_in_rect(x2, y2, x1, y1, rx, ry, rw, rh)) { |
1674 | lcd_drawrect(rx, ry, rw, rh); | 1674 | lcd_drawrect(rx, ry, rw, rh); |
1675 | lcd_drawline(x1, y1, x2, y2); | 1675 | lcd_drawline(x1, y1, x2, y2); |
1676 | lcd_putsxy(0, 0, "failed 10", 0); | 1676 | lcd_putsxy(0, 0, "failed 10"); |
1677 | lcd_update(); | 1677 | lcd_update(); |
1678 | button_get(true); | 1678 | button_get(true); |
1679 | testfailed = 10; | 1679 | testfailed = 10; |
@@ -1685,7 +1685,7 @@ static int testline_in_rect(void) { | |||
1685 | line_in_rect(x2, y2, x1, y1, rx, ry, rw, rh)) { | 1685 | line_in_rect(x2, y2, x1, y1, rx, ry, rw, rh)) { |
1686 | lcd_drawrect(rx, ry, rw, rh); | 1686 | lcd_drawrect(rx, ry, rw, rh); |
1687 | lcd_drawline(x1, y1, x2, y2); | 1687 | lcd_drawline(x1, y1, x2, y2); |
1688 | lcd_putsxy(0, 0, "failed 11", 0); | 1688 | lcd_putsxy(0, 0, "failed 11"); |
1689 | lcd_update(); | 1689 | lcd_update(); |
1690 | button_get(true); | 1690 | button_get(true); |
1691 | testfailed = 11; | 1691 | testfailed = 11; |
@@ -1698,7 +1698,7 @@ static int testline_in_rect(void) { | |||
1698 | line_in_rect(x2, y2, x1, y1, rx, ry, rw, rh)) { | 1698 | line_in_rect(x2, y2, x1, y1, rx, ry, rw, rh)) { |
1699 | lcd_drawrect(rx, ry, rw, rh); | 1699 | lcd_drawrect(rx, ry, rw, rh); |
1700 | lcd_drawline(x1, y1, x2, y2); | 1700 | lcd_drawline(x1, y1, x2, y2); |
1701 | lcd_putsxy(0, 0, "failed 12", 0); | 1701 | lcd_putsxy(0, 0, "failed 12"); |
1702 | lcd_update(); | 1702 | lcd_update(); |
1703 | button_get(true); | 1703 | button_get(true); |
1704 | testfailed = 12; | 1704 | testfailed = 12; |
@@ -1715,10 +1715,10 @@ static int testline_in_rect(void) { | |||
1715 | x2 = 10; | 1715 | x2 = 10; |
1716 | y2 = 20; | 1716 | y2 = 20; |
1717 | if (!(line_in_rect(x1, y1, x2, y2, rx, ry, rw, rh) && | 1717 | if (!(line_in_rect(x1, y1, x2, y2, rx, ry, rw, rh) && |
1718 | line_in_rect(x2, y2, x1, y1, rx, ry, rw, rh))) { | 1718 | line_in_rect(x2, y2, x1, y1, rx, ry, rw, rh))) { |
1719 | lcd_drawrect(rx, ry, rw, rh); | 1719 | lcd_drawrect(rx, ry, rw, rh); |
1720 | lcd_drawline(x1, y1, x2, y2); | 1720 | lcd_drawline(x1, y1, x2, y2); |
1721 | lcd_putsxy(0, 0, "failed 13", 0); | 1721 | lcd_putsxy(0, 0, "failed 13"); |
1722 | lcd_update(); | 1722 | lcd_update(); |
1723 | button_get(true); | 1723 | button_get(true); |
1724 | testfailed = 13; | 1724 | testfailed = 13; |
@@ -1735,10 +1735,10 @@ static int testline_in_rect(void) { | |||
1735 | x2 = 10; | 1735 | x2 = 10; |
1736 | y2 = 19; | 1736 | y2 = 19; |
1737 | if (!(line_in_rect(x1, y1, x2, y2, rx, ry, rw, rh) && | 1737 | if (!(line_in_rect(x1, y1, x2, y2, rx, ry, rw, rh) && |
1738 | line_in_rect(x2, y2, x1, y1, rx, ry, rw, rh))) { | 1738 | line_in_rect(x2, y2, x1, y1, rx, ry, rw, rh))) { |
1739 | lcd_drawline(x1, y1, x2, y2); | 1739 | lcd_drawline(x1, y1, x2, y2); |
1740 | lcd_invertrect(rx, ry, rw, rh); | 1740 | lcd_invertrect(rx, ry, rw, rh); |
1741 | lcd_putsxy(0, 0, "failed 14", 0); | 1741 | lcd_putsxy(0, 0, "failed 14"); |
1742 | lcd_update(); | 1742 | lcd_update(); |
1743 | button_get(true); | 1743 | button_get(true); |
1744 | testfailed = 14; | 1744 | testfailed = 14; |
@@ -1780,7 +1780,7 @@ static int test_specific_worm_collision(void) { | |||
1780 | } | 1780 | } |
1781 | lcd_invertpixel(x + FIELD_RECT_X, y + FIELD_RECT_Y); | 1781 | lcd_invertpixel(x + FIELD_RECT_X, y + FIELD_RECT_Y); |
1782 | snprintf(buf, sizeof buf, "collisions %d", collisions); | 1782 | snprintf(buf, sizeof buf, "collisions %d", collisions); |
1783 | lcd_putsxy(0, LCD_HEIGHT - 8, buf, 0); | 1783 | lcd_putsxy(0, LCD_HEIGHT - 8, buf); |
1784 | lcd_update(); | 1784 | lcd_update(); |
1785 | } | 1785 | } |
1786 | } | 1786 | } |
@@ -1837,7 +1837,7 @@ static void test_make_argh(void){ | |||
1837 | } | 1837 | } |
1838 | 1838 | ||
1839 | snprintf(buf, sizeof buf, "(%d;%d) fail%d try%d", x, y, failures, tries); | 1839 | snprintf(buf, sizeof buf, "(%d;%d) fail%d try%d", x, y, failures, tries); |
1840 | lcd_putsxy(0, LCD_HEIGHT - 8, buf, 0); | 1840 | lcd_putsxy(0, LCD_HEIGHT - 8, buf); |
1841 | lcd_update(); | 1841 | lcd_update(); |
1842 | lcd_invertrect(x + FIELD_RECT_X, y+ FIELD_RECT_Y, ARGH_SIZE, ARGH_SIZE); | 1842 | lcd_invertrect(x + FIELD_RECT_X, y+ FIELD_RECT_Y, ARGH_SIZE, ARGH_SIZE); |
1843 | lcd_update(); | 1843 | lcd_update(); |
@@ -1875,7 +1875,7 @@ static void test_worm_argh_collision_in_moves(void) { | |||
1875 | hit_count ++; | 1875 | hit_count ++; |
1876 | } | 1876 | } |
1877 | snprintf(buf, sizeof buf, "in 5 moves hits: %d", hit_count); | 1877 | snprintf(buf, sizeof buf, "in 5 moves hits: %d", hit_count); |
1878 | lcd_putsxy(0, LCD_HEIGHT - 8, buf, 0); | 1878 | lcd_putsxy(0, LCD_HEIGHT - 8, buf); |
1879 | lcd_update(); | 1879 | lcd_update(); |
1880 | } | 1880 | } |
1881 | if (hit_count != ARGH_SIZE + 5) { | 1881 | if (hit_count != ARGH_SIZE + 5) { |