You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 
 
 
 

18 lines
550 B

<script lang="ts">
import { createEventDispatcher } from "svelte";
const a = Math.floor(Math.random() * 80) + 20
const b = Math.floor(Math.random() * 80) + 20
const eventDispatcher = createEventDispatcher()
function newValue(val: number) {
if (a + b == val) {
eventDispatcher("done")
}
}
</script>
<div>
<p>Úlohu zatím nemáš vyřešenou, opravdu si chceš vyzradit řešení?</p>
{a} + {b} = <input type=text pattern="[0-9]*" on:input={e => newValue(+e.currentTarget.value)}>
</div>