Skip to main content
Full program is shorter
Source Link
AlexRacer
  • 1k
  • 1
  • 6
  • 11

Pascal (FPC), 175165 bytes

var f:string='. . . .'#10' . . .'#10' . .'#10' .';i:byte;z:array[1..10]of byte=(25,18,20,10,12,14,1,3,5,7);begin repeat read(i);f[z[i]]:='O'until eof;write(f)end. 

Try it online!

Takes numbers from standard input, prints the formation to standard output.

Pascal (FPC), 175 bytes

function f(q:array of byte):string;var i:byte;z:array[1..10]of byte=(25,18,20,10,12,14,1,3,5,7);begin f:='. . . .'#10' . . .'#10' . .'#10' .';for i in q do f[z[i]]:='O'end; 

Try it online!

A function which takesdoes the same thing, taking an array of pin positions and returnsreturning a formatted string.

Pascal (FPC), 175 bytes

function f(q:array of byte):string;var i:byte;z:array[1..10]of byte=(25,18,20,10,12,14,1,3,5,7);begin f:='. . . .'#10' . . .'#10' . .'#10' .';for i in q do f[z[i]]:='O'end; 

Try it online!

A function which takes an array of pin positions and returns a formatted string.

Pascal (FPC), 165 bytes

var f:string='. . . .'#10' . . .'#10' . .'#10' .';i:byte;z:array[1..10]of byte=(25,18,20,10,12,14,1,3,5,7);begin repeat read(i);f[z[i]]:='O'until eof;write(f)end. 

Try it online!

Takes numbers from standard input, prints the formation to standard output.

Pascal (FPC), 175 bytes

function f(q:array of byte):string;var i:byte;z:array[1..10]of byte=(25,18,20,10,12,14,1,3,5,7);begin f:='. . . .'#10' . . .'#10' . .'#10' .';for i in q do f[z[i]]:='O'end; 

Try it online!

A function which does the same thing, taking an array of pin positions and returning a formatted string.

Source Link
AlexRacer
  • 1k
  • 1
  • 6
  • 11

Pascal (FPC), 175 bytes

function f(q:array of byte):string;var i:byte;z:array[1..10]of byte=(25,18,20,10,12,14,1,3,5,7);begin f:='. . . .'#10' . . .'#10' . .'#10' .';for i in q do f[z[i]]:='O'end; 

Try it online!

A function which takes an array of pin positions and returns a formatted string.