This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//税金の計算機 | |
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="UTF-8"/> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="shortcut icon" href="./images/favicon.ico"> | |
<title>Carousel</title> | |
<!-- CSS --> | |
<link rel="stylesheet" href="./libs/bootstrap/bootstrap.min.css"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 基本情報技術者アルゴリズム対策 | |
* 練習: 15 | |
* デバッガでのトレースで動きを確かめること | |
* nの階乗を求めるアルゴリズム | |
*/ | |
let fact = (n)=>{ | |
if(n <= 1){ | |
return 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let gcd1 = (m,n)=>{ | |
if(n < m){ | |
return gcd2(m,n); | |
}else{ | |
return gcd2(n,m); | |
} | |
} | |
let gcd2 = (a,b)=>{ | |
let t = a % b;//a/bのあまり |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log("main.js!!"); | |
let i = 1;// | |
while(i <10){ | |
//console.log("i:",i); | |
let j = 1;// | |
while(j < 10){ | |
//console.log("j:",j); | |
console.log(i*j); | |
j = j + 1 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let fizzbuzz = ()=>{ | |
let n = 100; | |
let i = 1; | |
while(i <= n){ | |
console.log("i:", i); | |
if(i%3 == 0){//3の倍数なら | |
console.log(i,"Fizz!!"); | |
} | |
else{//3の倍数でない | |
console.log(i,"3倍でない"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log("main.js!!"); | |
function draw() { | |
background(80); | |
stroke(10); | |
strokeWeight(8); | |
noFill(); | |
if (mouseIsPressed) { | |
rectMode(CENTER); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log("main.js!!"); | |
/** | |
* p5.js連続して実行される関数 | |
*/ | |
function draw() { | |
background(50); | |
stroke(255); | |
strokeWeight(8); | |
noFill(); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function altRan2() { | |
var r = Math.floor(Math.random() * 6) +1; //乱数の発生 | |
document.getElementById("sai").innerHTML = r; //値の出力 | |
} | |
function altRan3() { | |
var r = Math.floor(Math.random() * 6) +1; //乱数の発生 | |
document.getElementById("sai1").innerHTML = r; //値の出力 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="UTF-8"/> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="shortcut icon" href="./images/favicon.ico"> | |
<title>Example</title> | |
<!-- CSS --> | |
<link rel="stylesheet" href="./css/custom.css"> | |
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var kudamono3 = ['りんご','もも','ぶどう','みかん','いちじく']; | |
kudamono3.sort();//反対から始まる | |
console.log(kudamono3); |
NewerOlder