T-SQL, 54 bytes (the trivial solution)
PRINT'(<(<>(<>.(<>.<(<>.<>(<>.<>)<>.<>)>.<>).<>)<>)>)'
I like this challenge, simple and yet so annoying.
I tried hard to find alternates, but nothing was shorter, due mostly due to the length of SQL keywords. Hmm, maybe I need to create GolfSQL with minimized keywords and other optimizations...
Here's my best attempt at a procedural solution (97 bytes golfed, presented here formatted):
DECLARE @ INT=-4, @o VARCHAR(99)=''
a:
SET @o+=SUBSTRING('(<>.<>)',@,7)
SET @+=1
IF @<7 GOTO a
PRINT @o
This works because SUBSTRING
can take a negative start value, in which case it simply reduces the length.
Edit: Found a slightly shorter non-trivial solution (96 bytes):
SELECT STRING_AGG(SUBSTRING('(<>.<>)',number-4,7),'')FROM
spt_values WHERE TYPE='P'AND number<11
Only works on MS SQL Server, where the master
database has a built-in system table called spt_values
. This table (when filtered by WHERE TYPE='P'
) can be used as a number table to generate the values from -4 to 6.
(<>.<>)
:"(<" + "(<>" + "(<>." + ... + "(<>.<>)" + "<>.<>)" + ">.<>)" + ... + ">)"
\$\endgroup\$