Skip to main content
Commonmark migration
Source Link

##QBIC, 10 bytes

QBIC, 10 bytes

:{?a~a|\_X 

Explanation:

: Reads a number from the command line and names it 'a' { DO - infinite loop ?a Print 'a' ~a IF 'a': 0 is seen as false, 1 as true | THEN: Empty THEN block, we want to act on FALSE \_X ELSE exit the program. _X accepts one implicit parameter, and prints that parameter on exit. Since no parameter is given, nothing gets printed. [IF and DO are implicitly closed by QBIC] 

##QBIC, 10 bytes

:{?a~a|\_X 

Explanation:

: Reads a number from the command line and names it 'a' { DO - infinite loop ?a Print 'a' ~a IF 'a': 0 is seen as false, 1 as true | THEN: Empty THEN block, we want to act on FALSE \_X ELSE exit the program. _X accepts one implicit parameter, and prints that parameter on exit. Since no parameter is given, nothing gets printed. [IF and DO are implicitly closed by QBIC] 

QBIC, 10 bytes

:{?a~a|\_X 

Explanation:

: Reads a number from the command line and names it 'a' { DO - infinite loop ?a Print 'a' ~a IF 'a': 0 is seen as false, 1 as true | THEN: Empty THEN block, we want to act on FALSE \_X ELSE exit the program. _X accepts one implicit parameter, and prints that parameter on exit. Since no parameter is given, nothing gets printed. [IF and DO are implicitly closed by QBIC] 
Source Link
steenbergh
  • 8.2k
  • 1
  • 27
  • 43

##QBIC, 10 bytes

:{?a~a|\_X 

Explanation:

: Reads a number from the command line and names it 'a' { DO - infinite loop ?a Print 'a' ~a IF 'a': 0 is seen as false, 1 as true | THEN: Empty THEN block, we want to act on FALSE \_X ELSE exit the program. _X accepts one implicit parameter, and prints that parameter on exit. Since no parameter is given, nothing gets printed. [IF and DO are implicitly closed by QBIC]