scene.org File Archive

File download

<root>­/­parties­/­2024­/­vccc24­/­christmas_challenge/michal-wrobel_sqlserver_sql_212b_vc3-2024.zip

File size:
75 012 bytes (73.25K)
File date:
2024-12-29 14:13:04
Download count:
all-time: 0

Preview

  • code.sql 212B
  • file_id.diz 958B
  • result.png 6.49K
  • source.png 21.84K
  • source_with_result.png 50.02K

file_id.diz

SQL twoliner

Author: Michal Wrobel
Category: Christmas Challenge
System:   Microsoft SQL Server 2005+
Language: SQL (Microsoft)
Len source code: 212
Len exe file:    -
Len code only:   -
Instructions:
Install SQL Server (can be free Express Edition version 2005 or newer), run SQL Server Management Studio,
connect to the server, choose "new query", paste the code, hit F5 to run.
Description:
As previous year, We have two loops, one for rows and one for columns. Loop counters are named @r and @ respectively.
Third variable, named @z is text buffer for output. Goto instruction is rarely used in wild, but it is possible and valid. 
For each posotion we calculate using case statement what character to print. It is possible to avoid spaces after 
several isnstructions, which saves some bytes.
Comments:
My solution is in SQL because SQL Server is what I use at work. Code is interpreted server-side so
there is no executable version.