-
Notifications
You must be signed in to change notification settings - Fork 4
/
linetest.ks
58 lines (47 loc) · 1.42 KB
/
linetest.ks
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
runoncepath("lib_list.ks").
list_position(0,round(terminal:width*0.75)-1,10,terminal:height-4).
clearscreen.
local wordlist is list("Lorem","ipsum","dolor",
"sit","amet","consectetur","adipiscing","elit",
"sed","do","eiusmod","tempor","incididunt",
"ut","labore","et","dolore","magna",
"aliqua","nisi").
set oldHeight to terminal:height.
set oldWidth to terminal:width.
function drawlines {
horizontalLine(9,"-").
verticalLineTo(round(terminal:width*0.75),10,terminal:height - 1,"|").
horizontalLineTo(terminal:height-3,0,round(terminal:width*0.75),"-").
}
print "test".
drawlines().
ag1 on.
until false {
if ag1 {
ag1 off.
local entry_str is "".
local i is 0.
until i > max(2,random() * 80) {
local word is round((wordlist:length-1) * random()).
set entry_str to entry_str + wordlist[word].
local rand is random().
if rand <= 0.01 set entry_str to entry_str + "! ".
else if rand <= 0.1 set entry_str to entry_str + ". ".
else if rand <= 0.25 set entry_str to entry_str + ", ".
else set entry_str to entry_str + " ".
set i to i + 1.
}
add_entry(entry_str:trimend() + ".").
print "ADDED: " + entry_str at (0,0).
}
if terminal:height <> oldHeight or terminal:width <> oldWidth {
list_position(0,round(terminal:width*0.75)-1,10,terminal:height-4).
clearscreen.
drawlines().
parse_list().
draw_list().
set oldHeight to terminal:height.
set oldWidth to terminal:width.
}
wait 0.
}