Skip to content

Commit e3e0446

Browse files
committed
sh managed to get to score 1.0 returns
1 parent d97a329 commit e3e0446

File tree

7 files changed

+62
-6
lines changed

7 files changed

+62
-6
lines changed

Diff for: environment.fish

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
source ../.venv/bin/activate.fish
2+
set -x LD_LIBRARY_PATH (realpath ../llvm-install-release/lib):$LD_LIBRARY_PATH
3+
set -x LD_LIBRARY_PATH (realpath ../llvm-install-debug/lib):$LD_LIBRARY_PATH
4+
set -x PATH (realpath ../llvm-install-release/bin/):$PATH

Diff for: environment.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
2-
source $DIR/../.venv/local/bin/activate
2+
source $DIR/../.venv/bin/activate
33
export LD_LIBRARY_PATH="$DIR/../llvm-install-release/lib/":$LD_LIBRARY_PATH
44
export LD_LIBRARY_PATH="$DIR/../llvm-install-debug/lib/":$LD_LIBRARY_PATH
55
export PATH="$DIR/../llvm-install-release/bin/":$PATH

Diff for: lib/lsp/src/LSP.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
66
You may obtain a copy of the License at
77
8-
http://www.apache.org/licenses/LICENSE-2.0
8+
http://www.apache.org/licenses/LICENSE-2.0
99
1010
Unless required by applicable law or agreed to in writing, software
1111
distributed under the License is distributed on an "AS IS" BASIS,

Diff for: stdlib/machine_learning.rl

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#
2+
#Copyright 2024 Massimo Fioravanti
3+
#
4+
#Licensed under the Apache License, Version 2.0 (the "License");
5+
#you may not use this file except in compliance with the License.
6+
#You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
#Unless required by applicable law or agreed to in writing, software
11+
#distributed under the License is distributed on an "AS IS" BASIS,
12+
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
#See the License for the specific language governing permissions and
14+
#limitations under the License.
15+
#
16+
import action
17+
import collections.vector
18+
import string
19+
20+
ent<T> Hidden:
21+
T value
22+
23+
fun assign(T content):
24+
self.value = content
25+
26+
fun<T> write_in_observation_tensor(Hidden<T> obj, Vector<Float> output, Int index):
27+
return
28+
29+
fun<T> size_as_observation_tensor(Hidden<T> obj) -> Int:
30+
return 0
31+
32+
fun<T> append_to_vector(Hidden<T> to_add, Vector<Byte> output):
33+
append_to_byte_vector(to_add.value, output)
34+
35+
fun<T> parse_from_vector(Hidden<T> to_add, Vector<Byte> output, Int index) -> Bool:
36+
return from_byte_vector(to_add.value, output, index)
37+
38+
fun<T> append_to_string(Hidden<T> to_add, String output):
39+
to_string(to_add.value, output)
40+
41+
fun<T> parse_string(Hidden<T> to_add, String input, Int index) -> Bool:
42+
return from_string(to_add.value, input, index)
43+

Diff for: stdlib/string.rl

+6
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,9 @@ fun<T> _to_string_impl(T to_add, String output):
229229
else:
230230
output.append('}')
231231

232+
fun<T> to_string(T to_stringyfi, String output):
233+
_to_string_impl(to_stringyfi, output)
234+
232235
fun<T> to_string(T to_stringyfi) -> String:
233236
let to_return : String
234237
_to_string_impl(to_stringyfi, to_return)
@@ -386,3 +389,6 @@ fun<T> _parse_string_impl(T result, String buffer, Int index) -> Bool:
386389
fun<T> from_string(T result, String buffer) -> Bool:
387390
let index = 0
388391
return _parse_string_impl(result, buffer, index)
392+
393+
fun<T> from_string(T result, String buffer, Int index) -> Bool:
394+
return _parse_string_impl(result, buffer, index)

Diff for: tool/rlc/src/Main.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ static cl::opt<bool> Optimize(
212212
cl::desc("Optimize"),
213213
cl::callback([](const bool &value) {
214214
emitPreconditionChecks.setInitialValue(!value);
215+
emitBoundChecks.setInitialValue(!value);
215216
}),
216217
cl::init(false),
217218
cl::cat(astDumperCategory));

Diff for: tool/rlc/test/examples/space_hulk/board.rl

+6-4
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
import unit
44
import bounded_arg
55
import collections.vector
6+
import machine_learning
67

78
using UnitArgType = BInt<0, 10>
89

10+
911
ent Board:
10-
BInt<0, 2>[29][28] map
12+
Hidden<BInt<0, 2>[29][28]> map
1113
HiddenInformation<BInt<0, 5>> command_points
1214
Vector<Unit> units
1315
Bool is_done
@@ -38,7 +40,7 @@ ent Board:
3840
while x != 29:
3941
if !(self.get_index_of_unit_at(x, y) is Nothing):
4042
to_print.append('o')
41-
else if self.map[y][x] == 1:
43+
else if self.map.value[y][x] == 1:
4244
to_print.append('X')
4345
else:
4446
to_print.append(' ')
@@ -71,7 +73,7 @@ ent Board:
7173
return false
7274
iter = iter + 1
7375

74-
return self.map[y][x] == 0
76+
return self.map.value[y][x] == 0
7577

7678
fun unit_id_is_valid(Int unit_id) -> Bool:
7779
return unit_id >= 0 and unit_id < 10 and unit_id < self.units.size()
@@ -202,7 +204,7 @@ fun make_board() -> Board:
202204
let y = 28
203205
while y != 0:
204206
y = y - 1
205-
board.map[y][x] = copy[y][x]
207+
board.map.value[y][x] = copy[y][x]
206208

207209
board.command_points.content = 0
208210
board.command_points.owner = 1

0 commit comments

Comments
 (0)