Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

Update MATL Online URL
Source Link
Suever
  • 11.2k
  • 1
  • 24
  • 52

MATL, 53 bytes

xXx`'./U;HbG#3@@!{uu'F'v^<>(")'Za7e 7YrY)D5M3>QG*&XxT

Moves are uniformly random.

Below is a sample run withn = 2. Or try it at MATL Online! MATL Online! (The interpreter is experimental. If it doesn't run initially try pressing "Run" again or refreshing the page).

enter image description here

Explanation

x % Take input n and delete it
Xx % Clear screen
` % Do...while
 './U;HbG#3@@!{uu' % Push this (compressed) string
 F % Specify source alphabet for decompression
 'v^<>(")' % Push target alphabet
 Za % Base conversion (decompress)
 7e % Reshape as a 7-row char matrix. Each row is a move
 7Yr % Push random integer from 1 to 7
 Y) % Select that row from the char matrix
 D % Display it
 5M % Push the integer again
 3> % Does it exceed 3? Gives false (0) or true (1)
 Q % Add 1
 G* % Multiply by n
 &Xx % Pause that many tenths of a second and clear screen
 T % Push true
 % End (implicit). Since top of the stack is true, this causes
 % and infinite loop

MATL, 53 bytes

xXx`'./U;HbG#3@@!{uu'F'v^<>(")'Za7e 7YrY)D5M3>QG*&XxT

Moves are uniformly random.

Below is a sample run withn = 2. Or try it at MATL Online! (The interpreter is experimental. If it doesn't run initially try pressing "Run" again or refreshing the page).

enter image description here

Explanation

x % Take input n and delete it
Xx % Clear screen
` % Do...while
 './U;HbG#3@@!{uu' % Push this (compressed) string
 F % Specify source alphabet for decompression
 'v^<>(")' % Push target alphabet
 Za % Base conversion (decompress)
 7e % Reshape as a 7-row char matrix. Each row is a move
 7Yr % Push random integer from 1 to 7
 Y) % Select that row from the char matrix
 D % Display it
 5M % Push the integer again
 3> % Does it exceed 3? Gives false (0) or true (1)
 Q % Add 1
 G* % Multiply by n
 &Xx % Pause that many tenths of a second and clear screen
 T % Push true
 % End (implicit). Since top of the stack is true, this causes
 % and infinite loop

MATL, 53 bytes

xXx`'./U;HbG#3@@!{uu'F'v^<>(")'Za7e 7YrY)D5M3>QG*&XxT

Moves are uniformly random.

Below is a sample run withn = 2. Or try it at MATL Online! (The interpreter is experimental. If it doesn't run initially try pressing "Run" again or refreshing the page).

enter image description here

Explanation

x % Take input n and delete it
Xx % Clear screen
` % Do...while
 './U;HbG#3@@!{uu' % Push this (compressed) string
 F % Specify source alphabet for decompression
 'v^<>(")' % Push target alphabet
 Za % Base conversion (decompress)
 7e % Reshape as a 7-row char matrix. Each row is a move
 7Yr % Push random integer from 1 to 7
 Y) % Select that row from the char matrix
 D % Display it
 5M % Push the integer again
 3> % Does it exceed 3? Gives false (0) or true (1)
 Q % Add 1
 G* % Multiply by n
 &Xx % Pause that many tenths of a second and clear screen
 T % Push true
 % End (implicit). Since top of the stack is true, this causes
 % and infinite loop
Commonmark migration
Source Link

#MATL , 53 bytes

MATL , 53 bytes

xXx`'./U;HbG#3@@!{uu'F'v^<>(")'Za7e 7YrY)D5M3>QG*&XxT

Moves are uniformly random.

Below is a sample run withn = 2. Or try it at MATL Online! (The interpreter is experimental. If it doesn't run initially try pressing "Run" again or refreshing the page).

enter image description here

###Explanation

Explanation

x % Take input n and delete it
Xx % Clear screen
` % Do...while
 './U;HbG#3@@!{uu' % Push this (compressed) string
 F % Specify source alphabet for decompression
 'v^<>(")' % Push target alphabet
 Za % Base conversion (decompress)
 7e % Reshape as a 7-row char matrix. Each row is a move
 7Yr % Push random integer from 1 to 7
 Y) % Select that row from the char matrix
 D % Display it
 5M % Push the integer again
 3> % Does it exceed 3? Gives false (0) or true (1)
 Q % Add 1
 G* % Multiply by n
 &Xx % Pause that many tenths of a second and clear screen
 T % Push true
 % End (implicit). Since top of the stack is true, this causes
 % and infinite loop

#MATL , 53 bytes

xXx`'./U;HbG#3@@!{uu'F'v^<>(")'Za7e 7YrY)D5M3>QG*&XxT

Moves are uniformly random.

Below is a sample run withn = 2. Or try it at MATL Online! (The interpreter is experimental. If it doesn't run initially try pressing "Run" again or refreshing the page).

enter image description here

###Explanation

x % Take input n and delete it
Xx % Clear screen
` % Do...while
 './U;HbG#3@@!{uu' % Push this (compressed) string
 F % Specify source alphabet for decompression
 'v^<>(")' % Push target alphabet
 Za % Base conversion (decompress)
 7e % Reshape as a 7-row char matrix. Each row is a move
 7Yr % Push random integer from 1 to 7
 Y) % Select that row from the char matrix
 D % Display it
 5M % Push the integer again
 3> % Does it exceed 3? Gives false (0) or true (1)
 Q % Add 1
 G* % Multiply by n
 &Xx % Pause that many tenths of a second and clear screen
 T % Push true
 % End (implicit). Since top of the stack is true, this causes
 % and infinite loop

MATL , 53 bytes

xXx`'./U;HbG#3@@!{uu'F'v^<>(")'Za7e 7YrY)D5M3>QG*&XxT

Moves are uniformly random.

Below is a sample run withn = 2. Or try it at MATL Online! (The interpreter is experimental. If it doesn't run initially try pressing "Run" again or refreshing the page).

enter image description here

Explanation

x % Take input n and delete it
Xx % Clear screen
` % Do...while
 './U;HbG#3@@!{uu' % Push this (compressed) string
 F % Specify source alphabet for decompression
 'v^<>(")' % Push target alphabet
 Za % Base conversion (decompress)
 7e % Reshape as a 7-row char matrix. Each row is a move
 7Yr % Push random integer from 1 to 7
 Y) % Select that row from the char matrix
 D % Display it
 5M % Push the integer again
 3> % Does it exceed 3? Gives false (0) or true (1)
 Q % Add 1
 G* % Multiply by n
 &Xx % Pause that many tenths of a second and clear screen
 T % Push true
 % End (implicit). Since top of the stack is true, this causes
 % and infinite loop
added 1074 characters in body
Source Link
Luis Mendo
  • 106.7k
  • 10
  • 139
  • 382

#MATL, 53 bytes

xXx`'./U;HbG#3@@!{uu'F'v^<>(")'Za7e 7YrY)D5M3>QG*&XxT

Moves are uniformly random.

Below is a sample run withn = 2. Or try it at MATL Online! (The interpreter is experimental. If it doesn't run initially try pressing "Run" again or refreshing the page).

enter image description here

###Explanation

x % Take input n and delete it
Xx % Clear screen
` % Do...while
 './U;HbG#3@@!{uu' % Push this (compressed) string
 F % Specify source alphabet for decompression
 'v^<>(")' % Push target alphabet
 Za % Base conversion (decompress)
 7e % Reshape as a 7-row char matrix. Each row is a move
 7Yr % Push random integer from 1 to 7
 Y) % Select that row from the char matrix
 D % Display it
 5M % Push the integer again
 3> % Does it exceed 3? Gives false (0) or true (1)
 Q % Add 1
 G* % Multiply by n
 &Xx % Pause that many tenths of a second and clear screen
 T % Push true
 % End (implicit). Since top of the stack is true, this causes
 % and infinite loop

#MATL, 53 bytes

xXx`'./U;HbG#3@@!{uu'F'v^<>(")'Za7e 7YrY)D5M3>QG*&XxT

Moves are uniformly random.

Below is a sample run withn = 2. Or try it at MATL Online! (The interpreter is experimental. If it doesn't run initially try pressing "Run" again or refreshing the page).

enter image description here

#MATL, 53 bytes

xXx`'./U;HbG#3@@!{uu'F'v^<>(")'Za7e 7YrY)D5M3>QG*&XxT

Moves are uniformly random.

Below is a sample run withn = 2. Or try it at MATL Online! (The interpreter is experimental. If it doesn't run initially try pressing "Run" again or refreshing the page).

enter image description here

###Explanation

x % Take input n and delete it
Xx % Clear screen
` % Do...while
 './U;HbG#3@@!{uu' % Push this (compressed) string
 F % Specify source alphabet for decompression
 'v^<>(")' % Push target alphabet
 Za % Base conversion (decompress)
 7e % Reshape as a 7-row char matrix. Each row is a move
 7Yr % Push random integer from 1 to 7
 Y) % Select that row from the char matrix
 D % Display it
 5M % Push the integer again
 3> % Does it exceed 3? Gives false (0) or true (1)
 Q % Add 1
 G* % Multiply by n
 &Xx % Pause that many tenths of a second and clear screen
 T % Push true
 % End (implicit). Since top of the stack is true, this causes
 % and infinite loop
deleted 2 characters in body
Source Link
Luis Mendo
  • 106.7k
  • 10
  • 139
  • 382
Loading
Source Link
Luis Mendo
  • 106.7k
  • 10
  • 139
  • 382
Loading

AltStyle によって変換されたページ (->オリジナル) /