g | x | w | all
Bytes Lang Time Link
nanNo HP250922T110101ZEka Juar
nanThis got bumped and piqued my curiosity. I decided to take on the harder version of the challenge240413T031940ZGammaFun
004Uiua240412T231821Znoodle p
003Vyxal240412T223541Zemanresu
039Ruby160501T011137ZValue In
063Python 3.5160430T025319ZR. Kap
010Jolf160430T181516ZConor O&
025Haskell160430T153038ZMichael
040JavaScript ES6160430T094029ZNeil
00705AB1E160430T085315ZAdnan
004Jelly160430T041348ZDennis
009Jelly160430T034852ZLeaky Nu
010Pyth160430T032706ZLeaky Nu
007J160430T032136Zmiles

No HP 83821328446 Hacker Pasword:080312isaw

This got bumped and piqued my curiosity. I decided to take on the harder version of the challenge, reading in a character at a time.

Zsh, 45 bytes

read -k1&&printf %s ${1::3}&&$0 ${1:3}${1::3}

Recursive call with the text rotated by three characters.

No TIO link, it won't work there because no terminal.

To run this,

A proper version with builtin noecho and tail call optimization is 51 bytes:

read -sk1&&printf %s ${1::3}&&exec $0 ${1:3}${1::3}

Uiua, 4 bytes

↯×3△

Try it!

Reshape the input to 3 multiplied by the shape of the other input.

Vyxal, 3 bytes

LTẎ

Try it Online!

  Ẏ # Slice input to length
 T  # 3 *
L   # Length of other input

Ruby, 39 bytes

In Ruby, $< reads from the supplied file in the command line arguments instead of $stdin if one is given. (If you forget to supply a file, you get a blank output because it reads everything out of $stdin in $<.read and thus STDIN.read.size will be 0.)

$><<($<.read*s=3*STDIN.read.size)[0,s]

Python 3.5, 77 65 63 bytes:

lambda g,f:''.join((g*len(f))[i:i+3]for i in range(0,len(f)*3,3))

Simple enough. An anonymous function which takes in two arguments, the first one being the "file" (g), and the second being the characters typed in by the user (f). Then this creates a generator containing every three characters in g, which are found by indexing for every i and then i+3 characters in g, where i is in the range of 0=>(length of f)*3. Finally, it returns each object in the generator joined into one big string. You call this function by assigning a variable to it, and then calling the variable wrapped inside a print() expression. So if the function's name was q, it would be executed like print(q(<byte array here>)).

Try it online! (repl.it)

Jolf, 10 bytes

]*iγl*I30γ

Try it here!

Explanation

]*iγl*I30γ
 *i        repeat string 1
    l*I3    the length of the other string * 3
   γ        γ = (^)
]       0γ  (^).slice(0, γ)

Haskell, 25 bytes

First argument is what's "typed", the second the source to display

(.cycle).take.(3*).length

Or non-pointfree, for (possibly) better readability:

h a=take(3*length a).cycle

JavaScript (ES6), 40 bytes

(s,t)=>s.repeat(l=t.length*3).slice(0,l)

Where s is the data string and t is the user string. Assumes s is nonempty and repeats it l times to ensure that its length is at least l so that it can return the first l characters, where l is three times the length of t.

05AB1E, 7 bytes

Code:

3×g©×®£

Explanation:

3×        # Multiply the input string three times.
  g       # Take the length.
   ©      # Copy that to the register.
    ×     # Multiply by the second input.
     ®    # Retrieve the length from the register.
      £   # Only keep [0:length * 3] from the new string.

Try it online!.

Jelly, 4 bytes

ẋ3ṁ@

Try it online!

How it works

ẋ3ṁ@    Main link. Arguments: s (input string), t (file string)

ẋ3      Repeat s three times.
  ṁ@    Mold; reshape t like the previous result.
        This repeats the elements of t over and over until the length matches that
        of s repeated thrice.

Jelly, 9 bytes

⁴L×3
ẋ¢ḣ¢

Try it online!

⁴L×3     Define nilad as ¢:

 L       length of
⁴        second argument
  ×3     tripled


ẋ¢ḣ¢     Main chain:
       
         the first argument (implicit)
ẋ        repeated
 ¢       ¢ many times
  ḣ¢     then get the first ¢ characters of it.

Pyth, 10 bytes

s@Ljb.z*3l

Try it online!

J, 7 bytes

$~(3*#)

Takes two arguments, the text to be repeated and the user's input text.

Usage

The input text is formatted where , means to join and LF is the newline character.

   f =: $~(3*#)
   ('#include <stdio.h>', LF, 'int main() { }') f 'hello world'
#include <stdio.h>
int main() { }
   'hello' f 'hello world'
hellohellohellohellohellohellohel

Try it online. (tryj.tk)