@jutge.org/toolkit 4.2.22 → 4.2.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/assets/problems/games/the-walking-dead.pbm/README.md +12 -0
  2. package/assets/problems/games/the-walking-dead.pbm/ca/Doc/Makefile +6 -0
  3. package/assets/problems/games/the-walking-dead.pbm/ca/Doc/api.tex +246 -0
  4. package/assets/problems/games/the-walking-dead.pbm/ca/Doc/defs.tex +2 -0
  5. package/assets/problems/games/the-walking-dead.pbm/ca/Doc/main.tex +63 -0
  6. package/assets/problems/games/the-walking-dead.pbm/ca/Doc/programming.tex +452 -0
  7. package/assets/problems/games/the-walking-dead.pbm/ca/Doc/rules.tex +222 -0
  8. package/assets/problems/games/the-walking-dead.pbm/ca/Doc/screenshot.png +0 -0
  9. package/assets/problems/games/the-walking-dead.pbm/ca/Doc/tips.tex +81 -0
  10. package/assets/problems/games/the-walking-dead.pbm/ca/Doc/twd.png +0 -0
  11. package/assets/problems/games/the-walking-dead.pbm/ca/Doc/viewer.tex +41 -0
  12. package/assets/problems/games/the-walking-dead.pbm/ca/Doc-eng/Makefile +6 -0
  13. package/assets/problems/games/the-walking-dead.pbm/ca/Doc-eng/api.tex +246 -0
  14. package/assets/problems/games/the-walking-dead.pbm/ca/Doc-eng/defs.tex +2 -0
  15. package/assets/problems/games/the-walking-dead.pbm/ca/Doc-eng/main.tex +63 -0
  16. package/assets/problems/games/the-walking-dead.pbm/ca/Doc-eng/programming.tex +176 -0
  17. package/assets/problems/games/the-walking-dead.pbm/ca/Doc-eng/rules.tex +194 -0
  18. package/assets/problems/games/the-walking-dead.pbm/ca/Doc-eng/screenshot.png +0 -0
  19. package/assets/problems/games/the-walking-dead.pbm/ca/Doc-eng/tips.tex +85 -0
  20. package/assets/problems/games/the-walking-dead.pbm/ca/Doc-eng/twd.png +0 -0
  21. package/assets/problems/games/the-walking-dead.pbm/ca/Doc-eng/viewer.tex +36 -0
  22. package/assets/problems/games/the-walking-dead.pbm/ca/Obj/AIDummy.o.Linux64 +0 -0
  23. package/assets/problems/games/the-walking-dead.pbm/ca/Obj/AIDummy.o.Linux64.Debug +0 -0
  24. package/assets/problems/games/the-walking-dead.pbm/ca/Obj/AIDummy.o.MacOS +0 -0
  25. package/assets/problems/games/the-walking-dead.pbm/ca/Obj/AIDummy.o.MacOS.ARM +0 -0
  26. package/assets/problems/games/the-walking-dead.pbm/ca/Obj/AIDummy.o.MacOS.ARM.Debug +0 -0
  27. package/assets/problems/games/the-walking-dead.pbm/ca/Obj/AIDummy.o.MacOS.Debug +0 -0
  28. package/assets/problems/games/the-walking-dead.pbm/ca/Obj/Board.o.Linux64 +0 -0
  29. package/assets/problems/games/the-walking-dead.pbm/ca/Obj/Board.o.Linux64.Debug +0 -0
  30. package/assets/problems/games/the-walking-dead.pbm/ca/Obj/Board.o.MacOS +0 -0
  31. package/assets/problems/games/the-walking-dead.pbm/ca/Obj/Board.o.MacOS.ARM +0 -0
  32. package/assets/problems/games/the-walking-dead.pbm/ca/Obj/Board.o.MacOS.ARM.Debug +0 -0
  33. package/assets/problems/games/the-walking-dead.pbm/ca/Obj/Board.o.MacOS.Debug +0 -0
  34. package/assets/problems/games/the-walking-dead.pbm/ca/Runner/AIDemo.cc +89 -0
  35. package/assets/problems/games/the-walking-dead.pbm/ca/Runner/AIDummy.cc +202 -0
  36. package/assets/problems/games/the-walking-dead.pbm/ca/Runner/AINull.cc +37 -0
  37. package/assets/problems/games/the-walking-dead.pbm/ca/Runner/Action.cc +34 -0
  38. package/assets/problems/games/the-walking-dead.pbm/ca/Runner/Action.hh +107 -0
  39. package/assets/problems/games/the-walking-dead.pbm/ca/Runner/Board.cc +975 -0
  40. package/assets/problems/games/the-walking-dead.pbm/ca/Runner/Board.hh +287 -0
  41. package/assets/problems/games/the-walking-dead.pbm/ca/Runner/Defs.hh +2 -0
  42. package/assets/problems/games/the-walking-dead.pbm/ca/Runner/Game.cc +55 -0
  43. package/assets/problems/games/the-walking-dead.pbm/ca/Runner/Game.hh +23 -0
  44. package/assets/problems/games/the-walking-dead.pbm/ca/Runner/Info.cc +174 -0
  45. package/assets/problems/games/the-walking-dead.pbm/ca/Runner/Info.hh +129 -0
  46. package/assets/problems/games/the-walking-dead.pbm/ca/Runner/Main.cc +83 -0
  47. package/assets/problems/games/the-walking-dead.pbm/ca/Runner/Makefile +56 -0
  48. package/assets/problems/games/the-walking-dead.pbm/ca/Runner/Player.cc +66 -0
  49. package/assets/problems/games/the-walking-dead.pbm/ca/Runner/Player.hh +63 -0
  50. package/assets/problems/games/the-walking-dead.pbm/ca/Runner/README.txt +9 -0
  51. package/assets/problems/games/the-walking-dead.pbm/ca/Runner/Random.cc +3 -0
  52. package/assets/problems/games/the-walking-dead.pbm/ca/Runner/Random.hh +88 -0
  53. package/assets/problems/games/the-walking-dead.pbm/ca/Runner/Registry.cc +28 -0
  54. package/assets/problems/games/the-walking-dead.pbm/ca/Runner/Registry.hh +42 -0
  55. package/assets/problems/games/the-walking-dead.pbm/ca/Runner/SecGame.cc +368 -0
  56. package/assets/problems/games/the-walking-dead.pbm/ca/Runner/SecGame.hh +90 -0
  57. package/assets/problems/games/the-walking-dead.pbm/ca/Runner/SecMain.cc +99 -0
  58. package/assets/problems/games/the-walking-dead.pbm/ca/Runner/Settings.cc +67 -0
  59. package/assets/problems/games/the-walking-dead.pbm/ca/Runner/Settings.hh +175 -0
  60. package/assets/problems/games/the-walking-dead.pbm/ca/Runner/State.cc +3 -0
  61. package/assets/problems/games/the-walking-dead.pbm/ca/Runner/State.hh +188 -0
  62. package/assets/problems/games/the-walking-dead.pbm/ca/Runner/Structs.cc +3 -0
  63. package/assets/problems/games/the-walking-dead.pbm/ca/Runner/Structs.hh +377 -0
  64. package/assets/problems/games/the-walking-dead.pbm/ca/Runner/Utils.cc +3 -0
  65. package/assets/problems/games/the-walking-dead.pbm/ca/Runner/Utils.hh +77 -0
  66. package/assets/problems/games/the-walking-dead.pbm/ca/Runner/default-fixed.cnf +120 -0
  67. package/assets/problems/games/the-walking-dead.pbm/ca/Runner/default.cnf +17 -0
  68. package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  69. package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  70. package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
  71. package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  72. package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  73. package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  74. package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  75. package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  76. package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  77. package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/css/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
  78. package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/css/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
  79. package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/css/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
  80. package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/css/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
  81. package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/css/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
  82. package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/css/ui-lightness/jquery-ui-1.8.18.custom.css +310 -0
  83. package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/help.html +18 -0
  84. package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/img/but_close.png +0 -0
  85. package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/img/but_end.png +0 -0
  86. package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/img/but_help.png +0 -0
  87. package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/img/but_pause.png +0 -0
  88. package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/img/but_play.png +0 -0
  89. package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/img/but_refresh.png +0 -0
  90. package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/img/but_start.png +0 -0
  91. package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/img/logo.png +0 -0
  92. package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/js/jquery-1.7.1.min.js +4 -0
  93. package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/js/jquery-ui-1.8.18.custom.min.js +49 -0
  94. package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/sample.out +52807 -0
  95. package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/viewer.html +118 -0
  96. package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/viewer.js +846 -0
  97. package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/viewer.sh +28 -0
  98. package/assets/problems/games/the-walking-dead.pbm/ca/handler.yml +6 -0
  99. package/assets/problems/games/the-walking-dead.pbm/ca/problem.ca.yml +3 -0
  100. package/assets/prompts/creators/create-solution.tpl.txt +15 -8
  101. package/assets/prompts/proglangs/cc.md +6 -2
  102. package/assets/prompts/proglangs/py.md +10 -6
  103. package/dist/index.js +370 -366
  104. package/docs/getting-started-guide.md +1 -1
  105. package/docs/install-linux.md +1 -1
  106. package/docs/install-macos.md +1 -1
  107. package/docs/install-windows.md +1 -1
  108. package/package.json +11 -11
  109. package/toolkit/ask.ts +0 -2
  110. package/toolkit/doctor.ts +1 -1
  111. package/toolkit/make.ts +2 -2
@@ -0,0 +1,28 @@
1
+ #!/bin/bash
2
+
3
+
4
+ command_exists () {
5
+ type "$1" &> /dev/null ;
6
+ }
7
+
8
+ UNAME=`uname`
9
+
10
+ #kiosk = "--kiosk"
11
+
12
+ if [ $UNAME = "Linux" ] ; then
13
+ if command_exists chromium-browser ; then
14
+ chromium-browser $kiosk --allow-file-access-from-files file://`pwd`/viewer.html?game=$1\&start=yes
15
+ elif command_exists chrome-browser ; then
16
+ chrome-browser $kiosk --allow-file-access-from-files file://`pwd`/viewer.html?game=$1\&start=yes
17
+ elif command_exists /opt/google/chrome/google-chrome ; then
18
+ /opt/google/chrome/google-chrome $kiosk --allow-file-access-from-files file://`pwd`/viewer.html?game=$1\&start=yes
19
+ elif command_exists firefox ; then
20
+ firefox file://`pwd`/viewer.html?game=$1\&start=yes
21
+ else
22
+ echo "Cannot find a browser"
23
+ fi
24
+ elif [ $UNAME = "Darwin" ] ; then
25
+ open -a "Google Chrome" --args --allow-file-access-from-files file://`pwd`/viewer.html?game=$1\&start=yes
26
+ else
27
+ echo "Unrecognized system"
28
+ fi
@@ -0,0 +1,6 @@
1
+ handler: game
2
+ game:
3
+ hide:
4
+ - Board.cc
5
+ - AIDummy.cc
6
+
@@ -0,0 +1,3 @@
1
+ title: TheWalkingDead
2
+ author: Albert Oliveras
3
+ email: oliveras@cs.upc.edu
@@ -1,10 +1,17 @@
1
- Now, write a solution in {{proglang}} to solve this problem
2
-
3
- It must be written in an idiomatic way and only include relevant comments.
4
- The code must be efficient and handle all edge cases.
5
- The code must read from standard input and write to standard output.
6
- The code must be well written and easy to understand to novices.
7
- The code does not have to check the preconditions stated in the problem statement.
8
- Do not use any non-standard libraries.
1
+ Now, write a solution in {{proglang}} to solve this problem.
2
+
3
+ Take these instructions into account:
4
+
5
+ - It must be written in an idiomatic way and only include relevant comments.
6
+
7
+ - The code must be efficient and handle all edge cases.
8
+
9
+ - The code must read from standard input and write to standard output.
10
+
11
+ - The code must be well written and easy to understand to novices. It cannot use advanced constructs.
12
+
13
+ - The code does not have to check the preconditions stated in the problem statement.
14
+
15
+ - Do not use any non-standard libraries.
9
16
 
10
17
  {{proglangPrompt}}
@@ -1,3 +1,7 @@
1
- Do not use fast input/output methods.
1
+ # Additional guidelines for C++
2
2
 
3
- Add a `using namespace std;` declaration after the includes and do not use `std::` prefixes.
3
+ - Do not use fast input/output methods.
4
+
5
+ - Add a `using namespace std;` declaration after the include section and do not use `std::` prefixes.
6
+
7
+ - Avoid the use of long long ints and use ints instead.
@@ -1,10 +1,14 @@
1
- Use f-strings for string formatting.
1
+ # Additional guidelines for Python
2
2
 
3
- Use type hints for function definitions. Do not use old-style type hints such as `List[int]` with `List` imported from `typing`, but use modern syntax such as `list[int]`.
3
+ - Use f-strings for string formatting when possible.
4
4
 
5
- Additionally, ensure that the generated Python3 code follows best practices, including proper indentation, use of functions, and adherence to PEP 8 style guidelines.
5
+ - Use type hints for function definitions. Do not use old-style type hints such as `List[int]` with `List` imported from `typing`, but use modern syntax such as `list[int]`.
6
6
 
7
- Important: Do not use `input()`, `sys.stdin()`, or `EOFError`` to read input as data can be placed freely across many lines. Instead, use the yogi library:
7
+ - Ensure that the generated Python3 code follows best practices, including proper indentation, use of functions, use of docstrings, and adherence to PEP 8 style guidelines.
8
+
9
+ # Very important
10
+
11
+ Do not use `input()`, `sys.stdin()`, or `EOFError` to read input as data can be placed freely across many lines. Instead, use the `yogi` library:
8
12
 
9
13
  `yogi` provides three functions for reading typed input:
10
14
 
@@ -24,7 +28,7 @@ x = scan(int) # returns int or None
24
28
  while x is not None:
25
29
  s += x
26
30
  x = scan(int) # returns int or None
27
- print(s)
31
+ print(s) # prints the sum of all the integers in the input
28
32
  ```
29
33
 
30
34
  **`tokens(type)`** - Iterator that yields tokens of specified type until input ends. Raises exception on type mismatch.
@@ -34,7 +38,7 @@ from yogi import tokens
34
38
  s = 0
35
39
  for x in tokens(int): # iterates over all integers in the input
36
40
  s += x
37
- print(s)
41
+ print(s) # prints the sum of all the integers in the input
38
42
  ```
39
43
 
40
44
  In yogi functions, `type` can be `int`, `float`, or `str`.