0
\$\begingroup\$

In PowerPoint, there's just one overly used feature: animations. For simplicity, that shape will be a non-rotated rectangle.

The data is specified as an array of eight integers: [2, 20, 30, 4, 5, 6, 7, 60] means create a 20-by-30 view, with the rectangle's top X at \$(4, 5)\$, with width 6 and height 7. Then, move at an angle of 60 degrees (not rotate). Finally, show two frames. Each frame, move it one unit in that direction. Coordinates start at \$(0, 0)\$, and coordinate Y is the distance (downward) from the top left (so not normal 2D planes)! Load the data in the input in any way you want.

For each coordinate As ASCII art is, well, blocky, draw with the following rules (calling the rectangle Rectangle A):

Define Square B as the rectangle at the current coordinate (at the top left) with width and height 1. Define Square C as the rectangle with the center of the "pixel," with width and height 2. Draw a # for the pixels that intersect Rectangle A and Square B with positive area. Otherwise, draw a * for pixels with the intersection of Rectangle A and Square C, again, with positive area. All other places should be a -. No whitespace or any other characters!

If you do not have access to sine and cosine, you may instead input it as a pre-calculated floating-point vector, but only if you don't have it.

Frames should be seperated with two newlines. This is , so the shortest answer in bytes wins!

Text cases (took a while to make):

Result for [10, 20, 20, 4, 4, 6, 8, 45]:

--------------------
--------------------
--------------------
--------------------
----*******---------
----*#####*---------
----*#####*---------
----*#####*---------
----*#####*---------
----*#####*---------
----*#####*---------
----*#####*---------
----*******---------
--------------------
--------------------
--------------------
--------------------
--------------------
--------------------
--------------------

--------------------
--------------------
--------------------
--------------------
----********--------
----*######*--------
----*######*--------
----*######*--------
----*######*--------
----*######*--------
----*######*--------
----*######*--------
----*######*--------
----********--------
--------------------
--------------------
--------------------
--------------------
--------------------
--------------------

--------------------
--------------------
--------------------
--------------------
--------------------
-----********-------
-----*######*-------
-----*######*-------
-----*######*-------
-----*######*-------
-----*######*-------
-----*######*-------
-----*######*-------
-----*######*-------
-----********-------
--------------------
--------------------
--------------------
--------------------
--------------------

--------------------
--------------------
--------------------
--------------------
--------------------
--------------------
------********------
------*######*------
------*######*------
------*######*------
------*######*------
------*######*------
------*######*------
------*######*------
------*######*------
------********------
--------------------
--------------------
--------------------
--------------------

--------------------
--------------------
--------------------
--------------------
--------------------
--------------------
------********------
------*######*------
------*######*------
------*######*------
------*######*------
------*######*------
------*######*------
------*######*------
------*######*------
------********------
--------------------
--------------------
--------------------
--------------------

--------------------
--------------------
--------------------
--------------------
--------------------
--------------------
--------------------
-------********-----
-------*######*-----
-------*######*-----
-------*######*-----
-------*######*-----
-------*######*-----
-------*######*-----
-------*######*-----
-------*######*-----
-------********-----
--------------------
--------------------
--------------------

--------------------
--------------------
--------------------
--------------------
--------------------
--------------------
--------------------
--------------------
--------********----
--------*######*----
--------*######*----
--------*######*----
--------*######*----
--------*######*----
--------*######*----
--------*######*----
--------*######*----
--------********----
--------------------
--------------------

--------------------
--------------------
--------------------
--------------------
--------------------
--------------------
--------------------
--------------------
--------********----
--------*######*----
--------*######*----
--------*######*----
--------*######*----
--------*######*----
--------*######*----
--------*######*----
--------*######*----
--------********----
--------------------
--------------------

--------------------
--------------------
--------------------
--------------------
--------------------
--------------------
--------------------
--------------------
--------------------
---------********---
---------*######*---
---------*######*---
---------*######*---
---------*######*---
---------*######*---
---------*######*---
---------*######*---
---------*######*---
---------********---
--------------------

--------------------
--------------------
--------------------
--------------------
--------------------
--------------------
--------------------
--------------------
--------------------
--------------------
----------********--
----------*######*--
----------*######*--
----------*######*--
----------*######*--
----------*######*--
----------*######*--
----------*######*--
----------*######*--
----------********--

Result for [5, 12, 12, 2, 3, 3, 3, 20]:

------------
------------
------------
--****------
--*##*------
--*##*------
--****------
------------
------------
------------
------------
------------

------------
------------
------------
--*****-----
--*###*-----
--*###*-----
--*###*-----
--*****-----
------------
------------
------------
------------

------------
------------
------------
---*****----
---*###*----
---*###*----
---*###*----
---*****----
------------
------------
------------
------------

------------
------------
------------
------------
----*****---
----*###*---
----*###*---
----*###*---
----*****---
------------
------------
------------

------------
------------
------------
------------
-----*****--
-----*###*--
-----*###*--
-----*###*--
-----*****--
------------
------------
------------
\$\endgroup\$

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.