-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmulti-line-task_hello-world.js
More file actions
72 lines (64 loc) · 1.05 KB
/
Copy pathmulti-line-task_hello-world.js
File metadata and controls
72 lines (64 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/**
Instructions:
You need to write a function f that returns the string Hello, world!.
Requirement: Every line must have at most 2 characters, and total number of lines must be less than 40.
Hint: It's possible to complete this in 28 lines only.
Solution:
f=_=>//coding and coding.. shorter and more shorter..
Sample Tests:
describe("Basic tests", function(){
it("It should work for basic tests", function(){
Test.assertEquals(f(),'Hello, world!');
});
});
describe("Code length check", function(){
it("Every line should have less than 3 characters", function(){
const limit = 3;
const lines = usercode.split('\n');
Test.expect(Math.max(...lines.map(s=>s.length))<limit, `Some lines of your code exceeded the character limit`);
});
it("There should be less than 40 lines", function(){
const limit = 40;
const lines = usercode.split('\n');
Test.expect(lines.length<limit, `Your code has ${lines.length} lines`);
});
});
*/
f=
[
]
[
`\
j\
o\
i\
n\
`
]
[
`\
b\
i\
n\
d\
`
]
(
[
`\
H\
e\
l\
l\
o\
,\
\
w\
o\
r\
l\
d\
!\
`
]
)