Commit b8dedaf1 authored by Tapio Mäntysalo's avatar Tapio Mäntysalo
Browse files

Starting to develop

parents
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome from file system",
"file": "${workspaceFolder}/index.html"
}
]
}
\ No newline at end of file
"use strict";
/**
* Returns the greatest common divisor of a and b.
*
* @param {number} a a positive integer
* @param {number} b a positive integer
* @return {number} The greatest common divisor of a and b
*/
function gcd(a, b) {
// See https://www.geeksforgeeks.org/c-program-find-gcd-hcf-two-numbers/
if (b == 0) return a;
return gcd(b, a%b);
}
\ No newline at end of file
<!DOCTYPE html>
<html>
<body>
<script>
function gcd(a, b) {
// See https://www.geeksforgeeks.org/c-program-find-gcd-hcf-two-numbers/
if (b == 0) return a;
return gcd(b, a%b);
}
let a = parseInt(prompt("Anna positiivinen kokonaisluku"));
let b = parseInt(prompt("Anna toinen pos. kokonaisluku"));
alert("Suurin yhteinen tekijä: " + gcd(a, b));
</script>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<body>
<script src = "example.js"></script>
<script>
// We could include also the following lines in the js file but
// I decided to put only functions there
let a = parseInt(prompt("Anna positiivinen kokonaisluku"));
let b = parseInt(prompt("Anna toinen pos. kokonaisluku"));
alert("Suurin yhteinen tekijä: " + gcd(a, b));
</script>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
</head>
<body>
<div class="container-md">
<div class="jumbotron">
<h1 class="display-4">Example</h1>
<p class="lead">This is the example provided.</p>
<!--<hr class="my-4">
<p>Test</p>
<a class="btn btn-primary btn-lg" href="#" role="button">Learn more</a>
-->
<table>
<tbody>
<tr>
<td>
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon1">Enter a positive integer</span>
</div>
<input type="number" class="form-control" placeholder="1" aria-label="positive-integer-1"
aria-describedby="basic-addon1">
</div>
</td>
<td>
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon1">Enter another positive
integer</span>
</div>
<input type="text" class="form-control" placeholder="2" aria-label="positive-integer-2"
aria-describedby="basic-addon1">
</div>
</td>
<td>
</td>
</tr>
</tbody>
</table>
<button type="button" class="btn btn-primary">Laske</button>
</div>
</div>
<script>
function gcd(a, b) {
// See https://www.geeksforgeeks.org/c-program-find-gcd-hcf-two-numbers/
if (b == 0) return a;
return gcd(b, a % b);
}
// let a = parseInt(prompt("Anna positiivinen kokonaisluku"));
// let b = parseInt(prompt("Anna toinen pos. kokonaisluku"));
// alert("Suurin yhteinen tekijä: " + gcd(a, b));
</script>
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js"
integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"
integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo"
crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"
integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6"
crossorigin="anonymous"></script>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment