Skip to main content
Commonmark migration
Source Link

#SimpleTemplate, 92 bytes

SimpleTemplate, 92 bytes

Takes the string as the first parameter and the "ratio" as the second.
The ratio is between 0 and 5, with 2 decimal places.

{@echoargv.0}{@callstrlen intoL argv.0}{@set*Y argv.1,L}{@callstr_repeat intoO")",Y}{@echoO} 

As you can see, it is non-optimal.
The 2 {echo} there could be reduced to 1.
Due to a bug in the compiler, this code can't be reduced much further.


Ungolfed:

{@echo argv.0} {@call strlen into length argv.0} {@set* ratio argv.1, length} {@call str_repeat into parenthesis ")", ratio} {@echo parenthesis} 

If no bug existed, the code would look like this, 86 bytes:

{@callstrlen intoL argv.0}{@set*Y argv.1,L}{@callstr_repeat intoO")",Y}{@echoargv.0,O} 

#SimpleTemplate, 92 bytes

Takes the string as the first parameter and the "ratio" as the second.
The ratio is between 0 and 5, with 2 decimal places.

{@echoargv.0}{@callstrlen intoL argv.0}{@set*Y argv.1,L}{@callstr_repeat intoO")",Y}{@echoO} 

As you can see, it is non-optimal.
The 2 {echo} there could be reduced to 1.
Due to a bug in the compiler, this code can't be reduced much further.


Ungolfed:

{@echo argv.0} {@call strlen into length argv.0} {@set* ratio argv.1, length} {@call str_repeat into parenthesis ")", ratio} {@echo parenthesis} 

If no bug existed, the code would look like this, 86 bytes:

{@callstrlen intoL argv.0}{@set*Y argv.1,L}{@callstr_repeat intoO")",Y}{@echoargv.0,O} 

SimpleTemplate, 92 bytes

Takes the string as the first parameter and the "ratio" as the second.
The ratio is between 0 and 5, with 2 decimal places.

{@echoargv.0}{@callstrlen intoL argv.0}{@set*Y argv.1,L}{@callstr_repeat intoO")",Y}{@echoO} 

As you can see, it is non-optimal.
The 2 {echo} there could be reduced to 1.
Due to a bug in the compiler, this code can't be reduced much further.


Ungolfed:

{@echo argv.0} {@call strlen into length argv.0} {@set* ratio argv.1, length} {@call str_repeat into parenthesis ")", ratio} {@echo parenthesis} 

If no bug existed, the code would look like this, 86 bytes:

{@callstrlen intoL argv.0}{@set*Y argv.1,L}{@callstr_repeat intoO")",Y}{@echoargv.0,O} 
Source Link
Ismael Miguel
  • 8k
  • 2
  • 27
  • 39

#SimpleTemplate, 92 bytes

Takes the string as the first parameter and the "ratio" as the second.
The ratio is between 0 and 5, with 2 decimal places.

{@echoargv.0}{@callstrlen intoL argv.0}{@set*Y argv.1,L}{@callstr_repeat intoO")",Y}{@echoO} 

As you can see, it is non-optimal.
The 2 {echo} there could be reduced to 1.
Due to a bug in the compiler, this code can't be reduced much further.


Ungolfed:

{@echo argv.0} {@call strlen into length argv.0} {@set* ratio argv.1, length} {@call str_repeat into parenthesis ")", ratio} {@echo parenthesis} 

If no bug existed, the code would look like this, 86 bytes:

{@callstrlen intoL argv.0}{@set*Y argv.1,L}{@callstr_repeat intoO")",Y}{@echoargv.0,O}