Compare commits

..

7 commits

Author SHA1 Message Date
a853814581
Fix typo in lesson 1
Some checks failed
deploy / test (push) Has been cancelled
fixes #4
2026-01-10 21:57:45 +01:00
4c02c9f137 Fix duplicate practice answers
Fixe #3
2026-01-10 20:46:08 +01:00
416f658e26
Update deploy.yml 2026-01-10 20:25:49 +01:00
c8539a7990
Update deploy.yml 2026-01-10 20:15:29 +01:00
775e00cb3c
Update deploy.yml 2026-01-10 20:14:56 +01:00
11301447d4
Update deploy.yml 2026-01-10 20:14:48 +01:00
d60694f013
Create deploy.yml 2026-01-10 20:08:33 +01:00
3 changed files with 43 additions and 17 deletions

27
.github/workflows/deploy.yml vendored Normal file
View file

@ -0,0 +1,27 @@
name: deploy
on:
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-22.04
environment: garage
steps:
- uses: actions/checkout@v4
- name: Copy website
run: |
mkdir dist
files=$(git ls-files | grep -E '\.(html|css|js)$')
cp --parents $files ./dist
- name: Deploy website
run: |
aws configure set default.s3.addressing_style path
aws s3 sync ./dist s3://womangling.noratrieb.dev
env:
AWS_ACCESS_KEY_ID: "${{ secrets.AWS_KEY_ID }}"
AWS_SECRET_ACCESS_KEY: "${{ secrets.AWS_SECRET_KEY }}"
AWS_REGION: garage
AWS_ENDPOINT_URL: https://garage.noratrieb.dev

View file

@ -1,19 +1,18 @@
const randomItem = (not) => {
let item;
do {
const idx = Math.floor(Math.random() * window.ITEMS.length);
item = window.ITEMS[idx];
} while (not && item === not);
return item;
};
const infoText = document.querySelector("#info-text"); const infoText = document.querySelector("#info-text");
function next() { function next() {
infoText.textContent = ""; infoText.textContent = "";
const item = randomItem();
const candiates = [...window.ITEMS];
const nextRandomItem = () => {
const idx = Math.floor(Math.random() * candiates.length);
const result = candiates[idx];
candiates.splice(idx, 1);
return result;
};
const item = nextRandomItem();
const mangle = Math.random() > 0.5; const mangle = Math.random() > 0.5;
@ -24,10 +23,10 @@ function next() {
children[1].textContent = mangle ? item.means : item.mangle; children[1].textContent = mangle ? item.means : item.mangle;
const options = [ const options = [
randomItem(item), nextRandomItem(item),
randomItem(item), nextRandomItem(item),
randomItem(item), nextRandomItem(item),
randomItem(item), nextRandomItem(item),
]; ];
const correctIdx = Math.floor(Math.random() * options.length); const correctIdx = Math.floor(Math.random() * options.length);
options[correctIdx] = item; options[correctIdx] = item;

View file

@ -31,7 +31,7 @@
Every C++ mangled symbol is prefixed with the string Every C++ mangled symbol is prefixed with the string
<code>_Z</code>. This signifies that this is a mangled C++ symbol. <code>_Z</code>. This signifies that this is a mangled C++ symbol.
<code>_Z</code> starts with an underscore followed by an uppercase <code>_Z</code> starts with an underscore followed by an uppercase
letter. All symbols of that structures are reserved by the C letter. All symbols of that structure are reserved by the C
standard and cannot be used by programs. This ensures that there are standard and cannot be used by programs. This ensures that there are
no name collisions with normal C functions and mangled C++ no name collisions with normal C functions and mangled C++
functions. functions.