forked from Bridgewater/scala-notebook
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path2.+An+HTML-mode+REPL.snb
72 lines (72 loc) · 1.72 KB
/
2.+An+HTML-mode+REPL.snb
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
{
"metadata":{
"name":"2. An HTML-mode REPL",
"user_save_timestamp":"2013-05-13T11:41:30.709Z",
"auto_save_timestamp":"2013-05-12T07:07:37.066Z"
},
"worksheets":[{
"cells":[{
"cell_type":"heading",
"source":"An HTML-mode REPL",
"level":1
},{
"cell_type":"code",
"input":"def fact(n: Int):Int = if (n == 0) 1 else n*fact(n-1)",
"language":"scala",
"collapsed":true,
"prompt_number":14,
"outputs":[]
},{
"cell_type":"code",
"input":"fact(10)",
"language":"scala",
"collapsed":true,
"prompt_number":15,
"outputs":[]
},{
"cell_type":"heading",
"source":"Representing Data",
"level":2
},{
"cell_type":"code",
"input":"for (n <- 1 to 10) yield fact(n)",
"language":"scala",
"collapsed":true,
"prompt_number":18,
"outputs":[]
},{
"cell_type":"code",
"input":"for (x <- -10d to 10 by .1) yield x*x",
"language":"scala",
"collapsed":true,
"prompt_number":26,
"outputs":[]
},{
"cell_type":"heading",
"source":"Speaking HTML",
"level":2
},{
"cell_type":"code",
"input":"<strong>Hello!</strong>",
"language":"scala",
"collapsed":true,
"prompt_number":27,
"outputs":[]
},{
"cell_type":"code",
"input":"<table>{ for (row <- 1 to 5) yield \n <tr>{ for (col <- 1 to 4) yield <td>{row*col}</td> }</tr>\n} </table>",
"language":"scala",
"collapsed":true,
"prompt_number":28,
"outputs":[]
},{
"cell_type":"code",
"input":"",
"language":"scala",
"collapsed":true,
"outputs":[]
}]
}],
"autosaved":[],
"nbformat":3
}