Jelly, 24 bytes
"Ṣẉ»ẇ8Ṇȧ®
ṫ-3;ƈ©Ȯ¤μ+Ç¿ṛ"
Explanation:
ṫ-3;ƈ©Ȯ¤μ+Ç¿ṛ" Main link. Arguments: 0
ṫ-3 Truncate the list to its 4 last elements.
;ƈ©Ȯ¤ Store a character from STDIN in the register, print it, and append it to the list (list is initially [0]).
μ Start a new monadic chain, everything to the left is a link.
Ç Execute the helper link with the existing list as its argument.
+ ¿ Do-while loop, left link is body, right link is condition.
ṛ" When the loop ends, replace the return value with [] (invisible on output).
"Ṣẉ»ẇ8Ṇȧ® Helper link. Arguments: string
"Ṣẉ»ẉ8Ṇ Check if "hello" isn't in the string.
® Return the character we stored in the register.
ȧ Check if both of the above are truthy.
Jelly, 24 bytes
"Ṣẉ»ẇ8Ṇȧ®
ṫ-3;ƈ©Ȯ¤μ+Ç¿ṛ"
Explanation:
ṫ-3;ƈ©Ȯ¤μ+Ç¿ṛ" Main link. Arguments: 0
ṫ-3 Truncate the list to its 4 last elements.
;ƈ©Ȯ¤ Store a character from STDIN in the register, print it, and append it to the list (list is initially [0]).
μ Start a new monadic chain, everything to the left is a link.
Ç Execute the helper link with the existing list as its argument.
+ ¿ Do-while loop, left link is body, right link is condition.
ṛ" When the loop ends, replace the return value with [] (invisible on output).
"Ṣẉ»ẇ8Ṇȧ® Helper link. Arguments: string
"Ṣẉ»ẉ8Ṇ Check if "hello" isn't in the string.
® Return the character we stored in the register.
ȧ Check if both of the above are truthy.
Jelly, 2124 bytes
"Ṣẉ»ẇ8Ṇȧ®
;ƈ©Ȯ¤$+Ç¿ṛ"ṫ-3;ƈ©Ȯ¤μ+Ç¿ṛ"
Explanation:Try it online!
;ƈ©Ȯ¤$+Ç¿ṛ" Main link. Arguments: 0
;ƈ©Ȯ¤$ Store a character from STDIN in the register, print it, and append it to the list ([0, input chars...]).
Ç Execute the helper link with the existing list as its argument.
+ ¿ Do-while loop, left link is body, right link is condition.
ṛ" When the loop ends, replace the return value with [] (invisible on output).
"Ṣẉ»ẇ8Ṇȧ® Helper link. Arguments: string
"Ṣẉ»ẉ8Ṇ Check if "hello" isn't in the string.
® Return the character we stored in the register.
ȧ Check if both of the above are truthy.
Jelly, 21 bytes
"Ṣẉ»ẇ8Ṇȧ®
;ƈ©Ȯ¤$+Ç¿ṛ"
Explanation:
;ƈ©Ȯ¤$+Ç¿ṛ" Main link. Arguments: 0
;ƈ©Ȯ¤$ Store a character from STDIN in the register, print it, and append it to the list ([0, input chars...]).
Ç Execute the helper link with the existing list as its argument.
+ ¿ Do-while loop, left link is body, right link is condition.
ṛ" When the loop ends, replace the return value with [] (invisible on output).
"Ṣẉ»ẇ8Ṇȧ® Helper link. Arguments: string
"Ṣẉ»ẉ8Ṇ Check if "hello" isn't in the string.
® Return the character we stored in the register.
ȧ Check if both of the above are truthy.
Jelly, 21 bytes
"Ṣẉ»ẇ8Ṇȧ®
;ƈ©Ȯ¤$+Ç¿ṛ"
Explanation:
;ƈ©Ȯ¤$+Ç¿ṛ" Main link. Arguments: 0
;ƈ©Ȯ¤$ Store a character from STDIN in the register, print it, and append it to the list ([0, input chars...]).
Ç Execute the helper link with the existing list as its argument.
+ ¿ Do-while loop, left link is body, right link is condition.
ṛ" When the loop ends, replace the return value with [] (invisible on output).
"Ṣẉ»ẇ8Ṇȧ® Helper link. Arguments: string
"Ṣẉ»ẉ8Ṇ Check if "hello" isn't in the string.
® Return the character we stored in the register.
ȧ Check if both of the above are truthy.
Jelly, 21 bytes
"Ṣẉ»ẇ8Ṇȧ®
;ƈ©Ȯ¤$+Ç¿ṛ"
Explanation:
;ƈ©Ȯ¤$+Ç¿ṛ" Main link. Arguments: 0
;ƈ©Ȯ¤$ Store a character from STDIN in the register, print it, and append it to the list ([0, input chars...]).
Ç Execute the helper link with the existing list as its argument.
+ ¿ Do-while loop, left link is body, right link is condition.
ṛ" When the loop ends, replace the return value with [] (invisible on output).
"Ṣẉ»ẇ8Ṇȧ® Helper link. Arguments: string
"Ṣẉ»ẉ8Ṇ Check if "hello" isn't in the string.
® Return the character we stored in the register.
ȧ Check if both of the above are truthy.
Loading