RubyStar

Author: Raul Gutierrez
Category: Christmas Challenge
System: Windows, Linux or any other able to run Ruby
Language: Ruby (tested on versions 2.7.7 and 3.1.3)
Len source code: 83 bytes
Len exe file: N/A (interpreted, not compiled)
Len code only: N/A (valid for assembler only)

Instructions:

Get Ruby binaries for your system (if you don't have it)
I got "Ruby 2.7.7-1 (x64)" from the "7-ZIP ARCHIVES" section
in https://rubyinstaller.org/downloads/
Uncompress to a folder. A "bin" subfolder will be created.
Save my RubyStar.rb file to that subfolder.
From command line (CMD or PowerShell, or a Linux shell) go to
that subfolder and execute: ruby RubyStar.rb

Description:

The program consists of 2 nested loops, for iterating Y and
X coordinates. Inside the inner loop, a function (turned into
an expression) returns if a blank or an asterisk should be
written at the current X,Y and the corresponding character is
written. And at the end of the outer loop, a line feed is
written. See more details in the comments below.

Comments:

I mapped the 17x17 char picture to a coordinate system with
X and Y ranging from -8 to 8.
This 17x17 grid is divided in 4 quadrants, and tried to make
a function which returns if an asterisk or a blank should be
written at a given X,Y cell.
I got a function which worked for a quadrant of the star, the
quadrant where both X and Y are positive or 0.
As the star is vertically and horizontally symmetrical, for
other quadrants I simply call the same function passing
absolute values of X and Y.

For code reduction I tried different languages and finally
used Ruby because:
 - No need to declare variables and types
 - No need to declare a main function
 - No need to use blanks, parentheses or new lines which
   other languages require
I apologise for not being retro, but I wanted to know the
minimum size I could reach.

The blank/asterisk function is just called from one place,
so I didn't write it as a function, but instead wrote its
code directly in that place, saving more bytes.

And the code of that function was optimized until I
couldn't made it shorter. First I convert it to a boolean
expression, and then it evolved, IIRC
from (b>4 && a>4 || b>4 && a+4<b || a>4 && a-4>b)
to   (b>4 && (a>4 || a+4<b) || a>4 && a-4>b)
to   (b>4 && a>4 || a+4<b || a>b+4)       and, finally
to   (b>4 && a>4 || (b-a).abs>4)
I hope there's no mistake here ;)

BTW, you can change the star dimensions if you replace
every "8" and "4" in the source code with any other even
number and its half (for example "14" and "7")
Just don't replace the "4" in "42" near the end.
