5 Commits f0ae444424 ... 92e1794259

Author SHA1 Message Date
  vaeringjar 92e1794259 Add new experiment related to LaTeX. 6 months ago
  vaeringjar ef94f43fdc Add new experiment related to algorithms. 6 months ago
  vaeringjar 79690358eb Add new experiment related to fiddling with dynaconf. 6 months ago
  vaeringjar c55d72e8e8 Save changes to Harvey. 6 months ago
  vaeringjar d2f68bbebf Save comp arch experiments. 6 months ago

+ 41 - 0
src/blog/src/archive/ttrpg/harvey_js_alansbarn.org

@@ -72,6 +72,47 @@ Brother John and I know each other because we delivered some heretics
 to justice one time. We speak Orc to each other.
 
 
+* Party Roles
+
+** Burglar (Stealth/SlightOfHand)
+
+- Brother John 11
+- Borg 5
+- Spiorad w/ Wildshape
+
+** Detective (Investigation/Insight)
+
+- Harvey 5/7
+- Felle 5
+- Kellar 4
+- Spiorad 4/6
+
+** Diplomat (Deception/Intimidation/Performance/Persuasion)
+
+- Esteral 7
+- Kellar 6
+- Felle 5
+
+** Medic (Medicine)
+
+- Harvey 7
+- Brother John 6
+- Felle 5
+
+** Scholar (Arcana/History/Religion)
+
+- Felle x/x/5
+- Kellar 4/4/4
+- Spiorad 4/x/x
+- Esteral x/3/3
+
+** Trailblazer (Survival)
+
+- Harvey 7
+- Spiorad 6
+- Borg 3
+
+
 * Log
 
 

+ 3 - 0
src/experiments/src/2024/algo/.gitignore

@@ -0,0 +1,3 @@
+.coverage
+.python-version
+poetry.lock

+ 8 - 0
src/experiments/src/2024/algo/Makefile

@@ -0,0 +1,8 @@
+.PHONY: dev
+dev:
+	@isort .
+	@black .
+	@ruff check
+	@py3clean src tests
+	@coverage run --source='.' -m unittest discover -s tests.algo_tests -t .
+	@coverage report -m

+ 1 - 0
src/experiments/src/2024/algo/README.org

@@ -0,0 +1 @@
+* stub

+ 28 - 0
src/experiments/src/2024/algo/pyproject.toml

@@ -0,0 +1,28 @@
+[tool.poetry]
+name = "algo"
+version = "0.1.0"
+description = ""
+authors = ["vaeringjar <vaeringjar@peers.community>"]
+
+
+[tool.poetry.dependencies]
+python = "^3.9"
+
+
+[tool.poetry.group.dev.dependencies]
+coverage = "^7.4.0"
+black = "^23.12.1"
+isort = "^5.13.2"
+pyclean = "^2.7.6"
+ruff = "^0.1.13"
+
+
+[tool.isort]
+profile = "black"
+skip_gitignore = true
+skip = [".venv"] # just in case the host doesn't have git
+
+
+[build-system]
+requires = ["poetry-core"]
+build-backend = "poetry.core.masonry.api"

+ 0 - 0
src/experiments/src/2024/algo/src/algo/__init__.py


+ 51 - 0
src/experiments/src/2024/algo/src/algo/rapid.py

@@ -0,0 +1,51 @@
+"""
+      Longest-Rapidly-Increasing(A[1, ..., n])
+          M[1, ..., n^2/2] = 0
+          i = 1
+          For i, ..., n-1
+              j = i
+              P[1, ..., n] = 0
+              For j, ..., n-1
+                  If 2A[j] $\leq$ A[j+1]
+                      P[i].push(A[j])
+              M[i] = P
+          S = max(M)
+          return S
+"""
+
+
+# def get_largest_rapidly_increasing(my_list):
+#     if len(my_list) < 2:
+#         return my_list
+#     list_of_lists = []
+#     for i, _ in enumerate(my_list):
+#         p_list = []
+#         p_list.append(my_list[i])
+#         for j, _ in enumerate(my_list[:-1]):
+#             if (2 * my_list[j]) <= my_list[j + 1]:
+#                 p_list.append(my_list[j + 1])
+
+#         print(p_list)
+#         list_of_lists.append(p_list)
+
+#     longest_list = max(list_of_lists, key=len)
+#     return longest_list
+
+
+def get_largest_rapidly_increasing(numbers):
+    if len(numbers) < 2:
+        return numbers
+
+    longest_seq = []
+
+    for i in range(len(numbers)):
+        current_seq = [numbers[i]]
+        for j in range(i + 1, len(numbers)):
+            if current_seq[-1] < 0.5 * numbers[j]:
+                current_seq.append(numbers[j])
+            else:
+                break
+        if len(current_seq) > len(longest_seq):
+            longest_seq = current_seq
+
+    return longest_seq

+ 70 - 0
src/experiments/src/2024/algo/src/algo/sorting.py

@@ -0,0 +1,70 @@
+def sorting1(my_list):
+    n = len(my_list) - 1
+    i_limit = 1 - 1
+    j_limit = 2 - 1
+    if n < 2:
+        return my_list
+    for i in range(n, i_limit, -1):
+        for j in range(n, j_limit, -1):
+            k = j - 1
+            if my_list[j] < my_list[k]:
+                my_list[j], my_list[k] = my_list[k], my_list[j]
+    return my_list
+
+
+def sorting2(my_list):
+    n = len(my_list) - 1
+    i_limit = 2 - 1
+    # j_limit = 2 - 1
+    if n < 2:
+        return my_list
+    for i in range(n, i_limit, -1):
+        j_limit = i - 1
+        for j in range(n, j_limit, -1):
+            k = j - 1
+            if my_list[j] < my_list[k]:
+                my_list[j], my_list[k] = my_list[k], my_list[j]
+    return my_list
+
+
+# TODO: Move to another module. Both of these have a bug, but they're close.
+def sum1a(my_list):
+    n = len(my_list)
+    s = 0
+    i = 1
+    while True:
+        if i <= n:
+            j = 1
+            while True:
+                if j <= n:
+                    j_index = j - 1
+                    s = s + my_list[j_index]
+                    j = j + 1
+                else:
+                    break  # pragma: no cover
+
+            i = 2 * i
+        else:
+            break  # pragma: no cover
+    return s
+
+
+def sum1b(my_list):
+    n = len(my_list)
+    s = 0
+    i = 1
+    while True:
+        if i <= n:
+            j = 1
+            while True:
+                if j <= n:
+                    j_index = j - 1
+                    s = s + my_list[j_index]
+                    j = j + i
+                else:
+                    break  # pragma: no cover
+
+            i = 2 * i
+        else:
+            break  # pragma: no cover
+    return s

+ 0 - 0
src/experiments/src/2024/algo/tests/algo_tests/__init__.py


+ 0 - 0
src/experiments/src/2024/algo/tests/algo_tests/test_algo1.py


Some files were not shown because too many files changed in this diff