Repository navigation
Expand file tree
/
Copy pathtest.js
More file actions
198 lines (145 loc) · 6.32 KB
/
Copy pathtest.js
File metadata and controls
198 lines (145 loc) · 6.32 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
// let string = "aaaaabvbbbcccccdddddeeeee"
// const { start } = require("discord");
// console.log(string.slice(0, 5))
// console.log(string.slice(5,10))
// console.log(string.slice(10, 15))
// console.log(string.slice(15, 20))
// console.log(__dirname)
// console.log("|" + " " +"\\");
// const { properties } = require('./test.json');
// let json = require('node:json')
// JSON.
// console.log(properties.ReferenceToLocalSchema.ref);
// "properties": {
// "ReferenceToLocalSchema
// let Max_length = 69, string = "sASDFASDasdfssadjfkladsjflkajsdfasdfkljasdfakldshfdashasd fasdf argbys fbwrsb", printString = ""
// function cutString(Max_length, string) {
// for (let index = Max_length; index >= 0; index--)
// if (string[index] == '\n' || string[index] == ' ' )
// return string.substring(0, index);
// }
// console.log(cutString(Max_length, string));
// function returnTwo() {
// return ["aaaaaa", 7]}
// }
// function printTwo(a, b) {
// console.log(a);
// console.log(b);
// }
// let aaa, bbb, ccc
// [aaa, bbb] = returnTwo()
// console.log(bbb);
// [aaa,bbb] = [3,2]
// console.log(aaa);
// console.log(bbb);
// [ccc] = returnTwo()
// console.log(ccc);
// printTwo([ccc] = returnTwo(),aaa)
// let eee = ["aaaaaaaaaaaa", 34] + 1
// console.log(eee[15]);
// function compareValues(string = "", number) {
// console.log(string.length, number);
// if (string.length > number)
// console.log("aaaaaa");
// if (string.length < number)
// console.log("bbbbbbb");
// }
// compareValues("aaaaaaaaaaaa", 5)
// compareValues("aaaaaaaaaaaa", 22)
// var texttobeprinted = "", lastprintedchar = 1, LineLength = 30
// let dialogue = "aaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbb cccccccccccccccccccccccc dddddddddddddddddd eeeeeeeeeeeeee"
// function fillSpacesRight(input, size){
// size -= input.length
// while (size != 0) {
// input = input + ' '
// size--;
// }
// return input
// }
// function cutString(string, Max_length ) {
// for (let index = Max_length; index >= 0; index--)
// if (string[index] == '\n' || string[index] == ' ' )
// return [string.substring(0, index), index];
// }
// function cutStringTwice(string, Start, Max_length ) {
// for (let index = Max_length; index >= 0; index--)
// if ((Start + index) < string.length)
// if (string[Start + index] == '\n' || string[Start + index] == ' ')
// return [string.substring(Start, Start + index), Start + index];
// //at htis point we are at the end of the string, i mark this with -1 ...
// return ["", -1]
// }
// dialogue = ' ' + dialogue + ' '
// for (let Line = 0; Line <= 8; Line++) {
// // ... so that i can intercept it later
// if (lastprintedchar) {
// [texttobeprinted, lastprintedchar] = cutStringTwice(dialogue, lastprintedchar, LineLength);
// console.log(" |"+ fillSpacesRight(texttobeprinted, LineLength)+"| ");
// // skip the ' ' at which we just cut of
// lastprintedchar++
// }else
// console.log(" |"+ fillSpacesRight("", LineLength)+"| ")
// }
// [texttobeprinted, lastprintedchar] = cutStringTwice(dialogue, 40, LineLength)
// console.log(texttobeprinted, lastprintedchar);
// [texttobeprinted, lastPrintedhar] = cutStringTwice(dialogue, lastprintedchar, LineLength)
// console.log(" |"+ fillSpacesRight(texttobeprinted, LineLength)+"| ");
// // [texttobeprinted, lastprintedchar] = cutString(dialogue.substring(lastprintedchar, dialogue.length))
// console.log(" |"+ fillSpacesRight(texttobeprinted, LineLength)+"| ");
// // fillSpacesRight(cutString(dialogue, LineLength))
//this ensures good line wrapping(, hopefully, havent tested it yet)
// console.log(" |" + dialogue.slice(0 + (LineLength * Line), (LineLength * (Line+1))) + "| ")
// console.log(String.fromCharCode(97) +"dgrs ");
// console.log("1234567890"*12);
// console.log("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
// aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
// jannes
// | jannes |
// function cutStringAtChar(string = "", char) {
// for (const key in string)
// if (string[key] == char)
// return string.substring(0, key)
// return string
// }
// function cutStringAtCharReverse(string = "", char = '') {
// for (let key = string.length; key != 0; key--)
// if (string[key] == char)
// return string.substring(++key, string.length)
// return string
// }
// console.log(
// cutStringAtCharReverse("asldddfk", 'd'))
// const obj = {
// testA: 1,
// testB: 2
// };
// const { testA, testB } = obj
// | d d? |
// | |
// | |
// |_
// function fillSpacesRight(input = "", size) {
// size -= input.length
// while (size >= 0) {
// input = input + ' '
// size--;
// }
// // console.log(input.length);
// return input
// }
// console.log(fillSpacesRight("aaaaaaaaaaaaaaa", 4));
// console.log("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
// console.log("a a");
// let temp = console.log("aaaaa");
// console.log(temp);
// if (condition) {
// console.log("AAAAAAAAAAA");
// }
// let temp2
// if (condition)
// console.log("AAAAAAAAAAA");
// let temp
let rs = require('readline-sync')
dice = rs.keyIn('Roll the dice, What will the result be? ',
{limit: '$<1-6>'})
direction = rs.keyIn('Left or Right? ', {limit: 'lr'});