Upgrade to Pro — share decks privately, control downloads, hide ads and more …

[KieLive#36] How to play with DMN

[KieLive#36] How to play with DMN

From the same creator of "DMN for developers". "How to play with DMN" smoothly approaches an uncommon problem and shows how to solve it with

About this event

[KieLive#36] How to play with DMN

Learning a new tool by following examples is great. You see things in practice, understand why those concepts exist and connect all the pieces. But that's not the real world.

In the real world, where problems are not designed to be resolve, we frequently struggle to solve totally unusual issues. In this talk, we will approach and understand how we can step-by-step solve an uncommon problem with DMN.

Link to the live streaming: https://red.ht/KieLive36

About the invited speaker:

Guilherme Carreiro, aka karreiro, is part of the KIE team since 2016 and currently the DMN Tooling lead. He's also the author of the learn-dmn-in-15-minutes.com course and frequently presents talks at conferences about his work. If you want to check more about him, he's an old-school-blogger at karreiro.com.

KIE Community

July 27, 2021
Tweet

More Decks by KIE Community

Other Decks in Technology

Transcript

  1. let state = { ... }; let gameLoop = ()

    => { state = executeDmn(state); paint(state); } setInterval(gameLoop, 40);
  2. Snake game client let gameLoop = () => { state

    = executeDmn(state); paint(state); } setInterval(gameLoop, 40);
  3. Snake game server let gameLoop = () => { state

    = executeDmn(state); paint(state); } setInterval(gameLoop, 40); HTTP requests Snake game client
  4. "state": { "snake": { "head": { "x": 2, "y": 4

    }, "body": [ { "x": 2, "y": 4 }, { "x": 1, "y": 4 } ] }, "apple": { "x": -1, "y": -1 }, "gameOver": false, "key": "Right", "score": 0 }
  5. "state": { "snake": { "head": { "x": 2, "y": 4

    }, "body": [ { "x": 2, "y": 4 }, { "x": 1, "y": 4 } ] }, "apple": { "x": -1, "y": -1 }, "gameOver": false, "key": "Right", "score": 0 } let state = { ... }; let gameLoop = () => { state = executeDmn(state); paint(state); } setInterval(gameLoop, 40);
  6. const grid = 20; const context = canvas.getContext("2d")!; function paintSnake(snake:

    Snake) { context.fillStyle = "#2ebd88"; [snake.head, ...snake.body].forEach((part) => { context.fillRect(part.x * grid, part.y * grid, grid, grid); }); } The infrastructure side
  7. function setKey(event: KeyboardEvent) { switch (event.key.toLowerCase()) { case "arrowup": case

    "w": key = "Up"; case "arrowdown": case "s": key = "Down"; case "arrowleft": case "a": key = "Left"; case "arrowright": case "d": key = "Right"; } } window.addEventListener("keydown", (event) => setKey(event), false); The infrastructure side
  8. "state": { "snake": { "head": { "x": 2, "y": 4

    }, "body": [ { "x": 2, "y": 4 }, { "x": 1, "y": 4 } ] }, "apple": { "x": -1, "y": -1 }, "gameOver": false, "key": "Right", "score": 0 } function paintSnake(snake: Snake) { context.fillStyle = "#2ebd88"; [snake.head, ...snake.body].forEach(( context.fillRect(part.x * grid, par }); } function paintApple(apple: Apple) { ... } function paintBlackBackground() { ... } function paintScore() { ... }