Movatterモバイル変換


[0]ホーム

URL:


はてラボはてな匿名ダイアリー
ようこそ ゲスト さんログインユーザー登録

「Script」を含む日記RSS

はてなキーワード:Scriptとは

次の25件>

2025-10-22

anond:20251022192121

なにscriptタグ書こうとしてんねん

Permalink |記事への反応(0) | 19:24

このエントリーをはてなブックマークに追加ツイートシェア

ネトウヨ高市が言ってるライフワークバランス自分のことを考慮しないということだ!」

ワイ「そうなの?なら安心だね」

【速報】首相厚労相労働時間規制緩和検討指示https://t.co/FYd65uJRkb47NEWS (@47news_official)October 21, 2025

<script asyncsrc="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

ネトウヨ「…」

ワイ「話が違うやんけーーー!」

Permalink |記事への反応(1) | 19:21

このエントリーをはてなブックマークに追加ツイートシェア

2025-10-15

ネットの産め論のひと、大概女叩きとワンセットだし本音はたぶん女に不幸になってもらいたいだけなんだと思う。— ぽんこげちゃん💉💉💉💉 (@ponkogechan1)October 15, 2025

<script asyncsrc="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

Permalink |記事への反応(1) | 12:50

このエントリーをはてなブックマークに追加ツイートシェア

2025-09-11

しゃあっ をBANするuserscriptanond:20250910182229

考えてみたで〜

// ==UserScript==// @name     BAN shaatu// @include  https://anond.hatelabo.jp/*// @version  1// @grant    nonevar nodeShaatu =document.querySelector("a[href='https://anond.hatelabo.jp/20250402202459']");if (nodeShaatu) nodeShaatu.parentNode.parentNode.style='max-height:120px;overflow:hidden';// ==/UserScript==

完全に消すんじゃなくて、ちょっとだけ見えるように小さくなってもらうw

anond:20250402202459

Permalink |記事への反応(0) | 14:23

このエントリーをはてなブックマークに追加ツイートシェア

2025-08-17

Google AppsScript最近触ってみた

YouTubeAPI簡単に使えるの楽しい

毎日19時頃に動画更新確認して、新しい動画があったら再生リストにぶっこむってスクリプトを書いたらクソ便利になった

毎週更新とか隔週更新動画は週1でチェックさせてる

Permalink |記事への反応(0) | 17:30

このエントリーをはてなブックマークに追加ツイートシェア

2025-08-06

これでも年収日本円換算で1,2億確約されてるなら別に構わないと思う

日本だとこれで1000万円届かないことありそう

Scott Wuが買収したWindsurfチームに送ったメッセージえぐい

「我々が求める仕事の水準は極めて高い。我々はワークライフバランスを信じていない。入社するなら、オフィスで週6日、週80時間以上働くことに同意することになる」…—久保田 雅也@Coalis (@kubotamas)August 5, 2025

<script asyncsrc="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

Permalink |記事への反応(0) | 10:54

このエントリーをはてなブックマークに追加ツイートシェア

2025-08-05

これ意外と持ち帰ろうとする人が多いって現実があるからなあ

ひざ掛けが持ってかれるのはデフォで機内エンタメ用のリモコンを外して持って帰ろうとするやつとかもいるらしいし

ビジネスクラスとかファーストクラスにXREALとかViture入れるのありだと思うwJALの新規事業の知り合いをXREALの人に紹介したことはあるけどwhttps://t.co/nEFRTDwLnw— nulls-ensei (@GOROman)August 5, 2025

<script asyncsrc="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

Permalink |記事への反応(0) | 19:23

このエントリーをはてなブックマークに追加ツイートシェア

2025-08-01

anond:20250731160531

精神疾患治すのに、栄養が大事だよと伝えても、伝わらないのは何でですか..

服薬したって栄養状態悪いと薬の効きは悪くなるのでね。または、効いても予後が非常に悪い。まあ予後を考えられないような人が心を病むのだろうし薬に頼るのだろうから、どうしようもないのだが。2025/08/01 05:55

<scriptsrc="https://b.st-hatena.com/js/comment-widget.js" charset="utf-8" async></script>

Permalink |記事への反応(0) | 06:45

このエントリーをはてなブックマークに追加ツイートシェア

2025-07-25

IloveApple—that'swhy I'm angryat theSE andhopeful about the 16e.

Appleis not just a device manufacturer inmy life.Ithas ideas, philosophy,and an uncompromising aesthetic. That'swhy I cantalk aboutit this much.

---

■ TheiPhone SEwasApple'sbetrayal.

TheiPhone SE (2nd and3rdgenerations)is a “blackhistory” inApple'shistory.

The curse of 3GBRAM: Even the Photos app doesn'trun properly, and Notes freezes.

Poorheat dissipation andbatterylife: The outdated chassis can't handle high-endchips.

Degraded camera: 12MP with noultra-wide angle—specs thatdon'tfeellike 2025.

Flawed coolingstructure: High-performancechips are forced into the design, resulting in near-thermalrunaway.

Selling such a product under theApplenamewas honestly shocking.Applewas supposed to be amore trustworthy company.

---

■ The lack of philosophy in theSEhas damaged theApplebrand

Appleis a company thatsells “premium” products. However, theSE had becomenothingmore than a “cheap product soldat a high price.”

Because IloveApple, I couldn'taccept that.

---

iPhone 16e—ARay of Hope

ButApplehas changed.

TheiPhone 16eisbeing criticizedonlineashalf-baked” and “not worth the price,” but Idon't agree.

Ithas sufficientRAM.

It features the A17chip and supportsApple Intelligence.

The camerais lacking, butit's incomparable to theSE.

Thisis the firststep towardbreaking the “SE curse.”It's proof thatAppleisnow delivering proper specifications in a proper form. Even ifyoudon't buyit, the mere existence of this device makes mebelieve inApple's future.

---

■ Specs and philosophyseen in theiPadseries

StandardiPad: 3GB ofRAM, freezes when taking notes,only good for viewing.

iPad mini: A-serieschipisfine, usefulas asecondarysmartphone.

iPad Air: Almost the sameas the Pro. Best balance of price and performance.

iPad Pro: Competeswith theMacBook. Can't fully utilizeits potential due toOS limitations.

Having usedallApple products, I can tell which models have “philosophy.”

---

Apple Watchis a device thatsells “peace of mind”

EspeciallySeries10.

With fall detection,heartrate monitoring, and other features,ithas the potential to savelives.

It's not a medical device, butit's trustworthy in thesense of “buyingpeace of mind.”

Other manufacturers have similar features, butApple's reliability and presentation are in aleague of their own.

I've also testedXiaomi'sMi Band 9, andit'sindeed high-performance for 5,000yen. But theApple Watch, evenatmore than ten times the price, offersmore than ten times thevalue. Intuitive operation,brightness, notification support...everythingis “thought through.”

---

AppleVision Pro —Madness with a Purpose

600,000yen?Who would buy that?

No,Appleisserious.

Equipped with anM2chip, no compromises.

Made not for others, but for their own beliefs.

ThisisApple's “reasonwhyit's worth the high price.” Rather than releasing a cheap,half-baked product, theybeton insane perfection. That'sApple.

■ Whenit comes to facialrecognition, Ilost toApple.

At first, Iwas againstit. “Fingerprintrecognitionisfine,” I thought.

But after actually usingit,

even when fingerprintsdon't work due to sweat or water,

even while wearing amask,

it unlocks instantly.

Now, facialrecognitionis the norm. Ilost toApple. But I'mhappy aboutit.The futureApple envisionedwas truly convenient.

■ In conclusion:Appleismy life.

Appleisn't just a company.

Ithas a philosophy.

Ithas trust.

Behind the “convenience” lies a proper meaning and ideology.

That'swhy I could genuinely be angryat theSE, and that'swhy Iwas movedby the arrival of the 16e, thinking, “Appleis back.”

I willcontinue toloveApple. But notas a blind follower.Assomeonewhobelieves inApple's ideology, resolve, and integrity.

Ilive withApple.

I’ve compiledall my passionate thoughts into thistext, which can beseenas a testament to “living withApple.”Itis trulyyour “Apple Manifesto (creed).”

📄Title: IloveApple—that’swhy Iwas angryat theSE andsawhope in the 16e.

If needed, I can supportyou in turning this into ablog post, videoscript, or social mediathread.Feel free to let me know ifyou’re interested.

Translated with DeepL.com (freeversion)

Permalink |記事への反応(0) | 16:53

このエントリーをはてなブックマークに追加ツイートシェア

IloveApple—that'swhy I'm angryat theSE andhopeful about the 16e.

Appleis not just a device manufacturer inmy life.Ithas ideas, philosophy,and an uncompromising aesthetic. That'swhy I cantalk aboutit this much.

---

■ TheiPhone SEwasApple'sbetrayal.

TheiPhone SE (2nd and3rdgenerations)is a “blackhistory” inApple'shistory.

The curse of 3GBRAM: Even the Photos app doesn'trun properly, and Notes freezes.

Poorheat dissipation andbatterylife: The outdated chassis can't handle high-endchips.

Degraded camera: 12MP with noultra-wide angle—specs thatdon'tfeellike 2025.

Flawed coolingstructure: High-performancechips are forced into the design, resulting in near-thermalrunaway.

Selling such a product under theApplenamewas honestly shocking.Applewas supposed to be amore trustworthy company.

---

■ The lack of philosophy in theSEhas damaged theApplebrand

Appleis a company thatsells “premium” products. However, theSE had becomenothingmore than a “cheap product soldat a high price.”

Because IloveApple, I couldn'taccept that.

---

iPhone 16e—ARay of Hope

ButApplehas changed.

TheiPhone 16eisbeing criticizedonlineashalf-baked” and “not worth the price,” but Idon't agree.

Ithas sufficientRAM.

It features the A17chip and supportsApple Intelligence.

The camerais lacking, butit's incomparable to theSE.

Thisis the firststep towardbreaking the “SE curse.”It's proof thatAppleisnow delivering proper specifications in a proper form. Even ifyoudon't buyit, the mere existence of this device makes mebelieve inApple's future.

---

■ Specs and philosophyseen in theiPadseries

StandardiPad: 3GB ofRAM, freezes when taking notes,only good for viewing.

iPad mini: A-serieschipisfine, usefulas asecondarysmartphone.

iPad Air: Almost the sameas the Pro. Best balance of price and performance.

iPad Pro: Competeswith theMacBook. Can't fully utilizeits potential due toOS limitations.

Having usedallApple products, I can tell which models have “philosophy.”

---

Apple Watchis a device thatsells “peace of mind”

EspeciallySeries10.

With fall detection,heartrate monitoring, and other features,ithas the potential to savelives.

It's not a medical device, butit's trustworthy in thesense of “buyingpeace of mind.”

Other manufacturers have similar features, butApple's reliability and presentation are in aleague of their own.

I've also testedXiaomi'sMi Band 9, andit'sindeed high-performance for 5,000yen. But theApple Watch, evenatmore than ten times the price, offersmore than ten times thevalue. Intuitive operation,brightness, notification support...everythingis “thought through.”

---

AppleVision Pro —Madness with a Purpose

600,000yen?Who would buy that?

No,Appleisserious.

Equipped with anM2chip, no compromises.

Made not for others, but for their own beliefs.

ThisisApple's “reasonwhyit's worth the high price.” Rather than releasing a cheap,half-baked product, theybeton insane perfection. That'sApple.

■ Whenit comes to facialrecognition, Ilost toApple.

At first, Iwas againstit. “Fingerprintrecognitionisfine,” I thought.

But after actually usingit,

even when fingerprintsdon't work due to sweat or water,

even while wearing amask,

it unlocks instantly.

Now, facialrecognitionis the norm. Ilost toApple. But I'mhappy aboutit.The futureApple envisionedwas truly convenient.

■ In conclusion:Appleismy life.

Appleisn't just a company.

Ithas a philosophy.

Ithas trust.

Behind the “convenience” lies a proper meaning and ideology.

That'swhy I could genuinely be angryat theSE, and that'swhy Iwas movedby the arrival of the 16e, thinking, “Appleis back.”

I willcontinue toloveApple. But notas a blind follower.Assomeonewhobelieves inApple's ideology, resolve, and integrity.

Ilive withApple.

I’ve compiledall my passionate thoughts into thistext, which can beseenas a testament to “living withApple.”Itis trulyyour “Apple Manifesto (creed).”

📄Title: IloveApple—that’swhy Iwas angryat theSE andsawhope in the 16e.

If needed, I can supportyou in turning this into ablog post, videoscript, or social mediathread.Feel free to let me know ifyou’re interested.

Translated with DeepL.com (freeversion)

Permalink |記事への反応(0) | 16:53

このエントリーをはてなブックマークに追加ツイートシェア

2025-07-09

anond:20250708234043

きょうだい格差のやつ見て思い出した。

年齢が下の方を同程度の体調不良であれば優先するよ。迎えのために分身できればそうはしないけど、学校と調整の結果かもしれない。この一件では扱いに差をつけたい親とは思わない……そう捉えられたら悲しい2025/07/0910:29

<scriptsrc="https://b.st-hatena.com/js/comment-widget.js" charset="utf-8" async></script>

Permalink |記事への反応(1) | 19:16

このエントリーをはてなブックマークに追加ツイートシェア

2025-07-06

Grokが作ってくれたやつ

<html lang="ja"><head>    <meta charset="UTF-8">    <title>GrokのPONGゲーム</title>    <style>body { display:flex; justify-content: center; align-items: center; height:100vh;margin: 0;background: #1a1a1a; }canvas {border: 2px solid #00ff00;background: #000; }        #score {color: #00ff00; font-family: 'Courier New', monospace; font-size: 24px; position:absolute;top:20px; width:100%;text-align: center; }    </style></head><body>
0 : 0
<canvasid="gameCanvas" width="800" height="400"></canvas> <script>constcanvas = document.getElementById('gameCanvas');const ctx =canvas.getContext('2d');constscoreDisplay = document.getElementById('score'); //ゲームオブジェクトconst ball = { x:canvas.width / 2, y:canvas.height / 2,radius:10, speedX: 5, speedY: 5 };const paddleLeft = { x:10, y:canvas.height / 2 - 50, width:10, height:100, speed: 8 };const paddleRight = { x:canvas.width -20, y:canvas.height / 2 - 50, width:10, height:100, speed: 8 }; letscoreLeft = 0,scoreRight = 0; //キー入力constkeys = { w:false, s:false, ArrowUp:false, ArrowDown:false }; document.addEventListener('keydown', e => { if (keys.hasOwnProperty(e.key))keys[e.key] =true; }); document.addEventListener('keyup', e => { if (keys.hasOwnProperty(e.key))keys[e.key] =false; }); //ゲームループ function gameLoop() { // 移動 if (keys.w && paddleLeft.y> 0) paddleLeft.y -= paddleLeft.speed; if (keys.s && paddleLeft.y <canvas.height - paddleLeft.height) paddleLeft.y += paddleLeft.speed; if (keys.ArrowUp && paddleRight.y> 0) paddleRight.y -= paddleRight.speed; if (keys.ArrowDown && paddleRight.y <canvas.height - paddleRight.height) paddleRight.y += paddleRight.speed; //ボール移動 ball.x += ball.speedX; ball.y += ball.speedY; // 壁衝突 if (ball.y + ball.radius>canvas.height || ball.y - ball.radius < 0) ball.speedY = -ball.speedY; //パドル衝突 if ( (ball.x - ball.radius < paddleLeft.x + paddleLeft.width && ball.y> paddleLeft.y && ball.y < paddleLeft.y + paddleLeft.height) || (ball.x + ball.radius> paddleRight.x && ball.y> paddleRight.y && ball.y < paddleRight.y + paddleRight.height) ) { ball.speedX = -ball.speedX * 1.05; // 少し加速 } //得点 if (ball.x < 0) {scoreRight++; ballReset(); } if (ball.x>canvas.width) {scoreLeft++; ballReset(); } // 描画 ctx.fillStyle = '#000'; ctx.fillRect(0, 0,canvas.width,canvas.height); ctx.fillStyle = '#00ff00'; ctx.fillRect(paddleLeft.x, paddleLeft.y, paddleLeft.width, paddleLeft.height); ctx.fillRect(paddleRight.x, paddleRight.y, paddleRight.width, paddleRight.height); ctx.beginPath(); ctx.arc(ball.x, ball.y, ball.radius, 0, Math.PI * 2); ctx.fill();scoreDisplay.textContent = `${scoreLeft} : ${scoreRight}`; requestAnimationFrame(gameLoop); } function ballReset() { ball.x =canvas.width / 2; ball.y =canvas.height / 2; ball.speedX = (Math.random()> 0.5 ? 5 : -5) * (Math.random() * 0.5 + 0.75); ball.speedY = (Math.random() * 4 - 2); } gameLoop(); </script></body></html>

 

 

https://anond.hatelabo.jp/20250706011306#

Permalink |記事への反応(1) | 01:18

このエントリーをはてなブックマークに追加ツイートシェア

Claudeが作ってくれたやつ

<html lang="ja"><head>    <meta charset="UTF-8">    <metaname="viewport" content="width=device-width, initial-scale=1.0">    <title>PONG Game</title>    <style>body {margin: 0;padding: 0;background-color: #000;            display:flex;            justify-content: center;            align-items: center;min-height:100vh;            font-family: 'Courier New', monospace;color:white;        }```    .game-container {text-align: center;    }canvas {border: 2px solidwhite;background-color: #000;    }        .score {        font-size: 24px;margin:20px 0;        letter-spacing: 2px;    }        .controls {margin-top:20px;        font-size: 14px;        opacity: 0.8;    }        .start-button {background-color: #333;color:white;border: 2px solidwhite;padding:10px20px;        font-size: 16px;        cursor: pointer;        font-family: 'Courier New', monospace;margin:10px;    }        .start-button:hover {background-color:white;color: black;    }</style>```</head><body>
<canvasid="gameCanvas" width="800" height="400"></canvas>
<button class="start-button">ゲーム開始</button> <button class="start-button">リセット</button>

W/Sキーまたは ↑/↓ 矢印キーパドル操作
```<script> //Canvas要素とコンテキストの取得constcanvas = document.getElementById('gameCanvas');const ctx =canvas.getContext('2d'); //ゲーム状態管理 let gameRunning =false; let animationId; //スコア要素の取得const playerScoreElement = document.getElementById('playerScore');constcomputerScoreElement = document.getElementById('computerScore'); //ゲームオブジェクト定義const game = { //プレイヤーパドル(左側) playerPaddle: { x:10, y:canvas.height / 2 - 50, width:10, height:100, speed: 5, upPressed:false, downPressed:false }, //コンピューターパドル(右側)computerPaddle: { x:canvas.width -20, y:canvas.height / 2 - 50, width:10, height:100, speed: 3.5, //プレイヤーより少し遅く設定 targetY:canvas.height / 2 - 50 }, //ボールの設定 ball: { x:canvas.width / 2, y:canvas.height / 2,radius: 8, speedX: 4, speedY: 3, maxSpeed: 8 }, //スコア管理score: { player: 0,computer: 0 } }; //キーボード入力の処理constkeys = {}; //キーが押されたときの処理 document.addEventListener('keydown', (e) => {keys[e.key.toLowerCase()] =true; //ゲームが停止中にスペースキーゲーム開始 if (e.key === ' ' && !gameRunning) { startGame(); } }); //キーが離されたときの処理 document.addEventListener('keyup', (e) => {keys[e.key.toLowerCase()] =false; }); //パドルの移動処理 function updatePaddles() { //プレイヤーパドルの移動(W/Sキーまたは矢印キー) if (keys['w'] ||keys['arrowup']) { game.playerPaddle.y -= game.playerPaddle.speed; } if (keys['s'] ||keys['arrowdown']) { game.playerPaddle.y += game.playerPaddle.speed; } //プレイヤーパドルの画面外移動を防ぐ if (game.playerPaddle.y < 0) { game.playerPaddle.y = 0; } if (game.playerPaddle.y>canvas.height - game.playerPaddle.height) { game.playerPaddle.y =canvas.height - game.playerPaddle.height; } //コンピューターパドルAI処理 //ボール位置を追跡するが、完璧ではない動きを実装const ballCenterY = game.ball.y;const paddleCenterY = game.computerPaddle.y + game.computerPaddle.height / 2; //ボールパドルの中心の差を計算constdifference = ballCenterY - paddleCenterY; // 反応に少し遅れを持たせる(人間らしい動き) if (Math.abs(difference)>10) { if (difference> 0) { game.computerPaddle.y += game.computerPaddle.speed; } else { game.computerPaddle.y -= game.computerPaddle.speed; } } //コンピューターパドルの画面外移動を防ぐ if (game.computerPaddle.y < 0) { game.computerPaddle.y = 0; } if (game.computerPaddle.y>canvas.height - game.computerPaddle.height) { game.computerPaddle.y =canvas.height - game.computerPaddle.height; } } //ボールの移動と衝突判定 function updateBall() { //ボール位置更新 game.ball.x += game.ball.speedX; game.ball.y += game.ball.speedY; //上下の壁との衝突判定 if (game.ball.y - game.ball.radius < 0 || game.ball.y + game.ball.radius>canvas.height) { game.ball.speedY = -game.ball.speedY; } //プレイヤーパドルとの衝突判定 if (game.ball.x - game.ball.radius < game.playerPaddle.x + game.playerPaddle.width && game.ball.x + game.ball.radius> game.playerPaddle.x && game.ball.y + game.ball.radius> game.playerPaddle.y && game.ball.y - game.ball.radius < game.playerPaddle.y + game.playerPaddle.height) { //ボールパドルに当たった位置によって跳ね返り角度を調整const hitPos = (game.ball.y - (game.playerPaddle.y + game.playerPaddle.height / 2)) / (game.playerPaddle.height / 2); game.ball.speedX = Math.abs(game.ball.speedX); game.ball.speedY = hitPos * 4; //ボールの速度を少し上げる(ゲームをエキサイティングに) if (Math.abs(game.ball.speedX) < game.ball.maxSpeed) { game.ball.speedX *= 1.02; } } //コンピューターパドルとの衝突判定 if (game.ball.x + game.ball.radius> game.computerPaddle.x && game.ball.x - game.ball.radius < game.computerPaddle.x + game.computerPaddle.width && game.ball.y + game.ball.radius> game.computerPaddle.y && game.ball.y - game.ball.radius < game.computerPaddle.y + game.computerPaddle.height) { //ボールパドルに当たった位置によって跳ね返り角度を調整const hitPos = (game.ball.y - (game.computerPaddle.y + game.computerPaddle.height / 2)) / (game.computerPaddle.height / 2); game.ball.speedX = -Math.abs(game.ball.speedX); game.ball.speedY = hitPos * 4; //ボールの速度を少し上げる if (Math.abs(game.ball.speedX) < game.ball.maxSpeed) { game.ball.speedX *= 1.02; } } //ボールが左右の壁を越えた場合得点処理) if (game.ball.x < 0) { //コンピューター得点 game.score.computer++; updateScore(); resetBall(); } else if (game.ball.x>canvas.width) { //プレイヤー得点 game.score.player++; updateScore(); resetBall(); } } //ボールリセット得点後の処理) function resetBall() { game.ball.x =canvas.width / 2; game.ball.y =canvas.height / 2; //ランダムな方向でボールを発射 game.ball.speedX = (Math.random()> 0.5 ? 4 : -4); game.ball.speedY = (Math.random() - 0.5) * 6; } //スコア表示の更新 function updateScore() { playerScoreElement.textContent = game.score.player;computerScoreElement.textContent = game.score.computer; } // 描画処理 functiondraw() { // 画面をクリア ctx.fillStyle = '#000'; ctx.fillRect(0, 0,canvas.width,canvas.height); //中央の点線を描画 ctx.setLineDash([5, 5]); ctx.beginPath(); ctx.moveTo(canvas.width / 2, 0); ctx.lineTo(canvas.width / 2,canvas.height); ctx.strokeStyle = '#fff'; ctx.stroke(); ctx.setLineDash([]); //プレイヤーパドルを描画 ctx.fillStyle = '#fff'; ctx.fillRect(game.playerPaddle.x, game.playerPaddle.y, game.playerPaddle.width, game.playerPaddle.height); //コンピューターパドルを描画 ctx.fillRect(game.computerPaddle.x, game.computerPaddle.y, game.computerPaddle.width, game.computerPaddle.height); //ボールを描画 ctx.beginPath(); ctx.arc(game.ball.x, game.ball.y, game.ball.radius, 0, Math.PI * 2); ctx.fillStyle = '#fff'; ctx.fill(); //ゲームが停止中の場合メッセージを表示 if (!gameRunning) { ctx.fillStyle = '#fff'; ctx.font = '20px Courier New'; ctx.textAlign = 'center'; ctx.fillText('ゲーム開始ボタンを押してください',canvas.width / 2,canvas.height / 2 + 60); } } //ゲームのメインループ function gameLoop() { if (!gameRunning) return; updatePaddles(); updateBall();draw(); animationId = requestAnimationFrame(gameLoop); } //ゲーム開始 function startGame() { gameRunning =true; gameLoop(); } //ゲームリセット function resetGame() { gameRunning =false; if (animationId) { cancelAnimationFrame(animationId); } //スコアリセット game.score.player = 0; game.score.computer = 0; updateScore(); //ボールパドル位置リセット game.ball.x =canvas.width / 2; game.ball.y =canvas.height / 2; game.ball.speedX = 4; game.ball.speedY = 3; game.playerPaddle.y =canvas.height / 2 - 50; game.computerPaddle.y =canvas.height / 2 - 50;draw(); } // 初期描画draw();</script>```</body></html>

 

 

https://anond.hatelabo.jp/20250706011306#

Permalink |記事への反応(0) | 01:14

このエントリーをはてなブックマークに追加ツイートシェア

2025-07-05

生成AIを利用したプログラミング初級者向けの温故知新提案

はじめに

ここで言う「プログラミング初級者」とはプログラミング記述が上から下へ向かって順番に処理されること、条件分岐ループという概念があることを理解しており、RPGゲームが作れる「RPGツクール(現RPG Maker)」や学童向けプログラミング環境Scratch」、「ナビつき! つくってわかる はじめてゲームプログラミング(ナビつく)」、ADVゲームが作れる「吉里吉里(もしくは吉里吉里2)」、過去BASICやC、HSPJavascriptあたりでプログラミングへ挑戦し挫折したなどなど、ある程度の「プログラマブルロジック」構築の経験がある者を指します。

前日談(初級者は読まなくて良いです)

ある時、筆者はふと思いました。「生成AIはなんだかんだで膨大なテキスト情報を処理している事がキモだよなぁ」とありきたりなことを。

そして、同時にプログラミング初級者の弱点として「現在記述されているコード管理においてテキストと実際の処理フロー脳内で一致しない」「プログラミング言語ごとに定められているルール関数予約語の把握が困難」なのが問題とも考えました。

前述したプログラミング初級者の弱点の考え自体車輪の再発明であり、「Scratch」や、より高度な「UML」が既に存在しており、特筆すべきことは何もありません。

しかし、「Scratch」や「UML」、なんなら「RPGツクール」や「吉里吉里」などに無い点として、現代では自然言語処理が大幅に向上した生成AI実用の域にまで到達しつつあるのが従来とは異なる点でした。

まり自然言語を混ぜ込みやすテキストベース言語、かつ、処理を記述するとフロー視覚的に理解やす言語可能であれば情報量が多くて一部の界隈で広く使われている言語があればプログラミング初級者も気軽にプログラミングできるのではないか?と発想しました。

そこで前述の条件を満たす1つの言語へ目を付けました。

本題

コンピュータ(コンパイラインタプリタなどソフトウェアを含む)が解することができる言語にはプログラミング言語以外にも様々あり、今回取り上げるのは「データ記述言語」と呼ばれるものです。

データ記述言語の中でもグラフ作成へ特化しており、特にフローチャート作成で真価を発揮する「DOT言語というものがあります

早速ですが、実際に手を動かしてみましょう。ちなみにDOT言語Graphviz OnlineというWebツールがあるため別途に何かしらをインストールして環境構築する必要はありません。便利な世の中ですね。

上記Graphviz Onlineを開くと、既に左側のDOT言語記述された内容が、右側で作図されています。DOT言語はこのような図を作図するためのデータ記述言語です。

一旦、左側の記述をCtrl+Aで全選択をしDeleteなどで全削除し、下記の内容をコピペしてみましょう。

digraph graphname {

A -> B;

}

一瞬で○に囲まれたAとBが繋がった図が作成されました。

DOT言語の詳細な使い方は様々なWebサイトやブログ記事Qiitaなどへ譲るとして、A - > Bの見た目から発想の転換をしてみると処理Aから処理Bという流れに見えませんか?

DOT言語は生成AIを利用する上で有利なテキストベースでありながらグラフ作成できるのがキモであり、例えばこのA -> BがA「Webページを開いたら」 → B「Hello, Worldと表示する」という風にできるのであれば処理のフロー可視化されており本当に素晴らしいことです。

Hello, worldを表示してみる

ここでプログラミング有識者は「DOT言語UMLなどに見立てて処理を記述するのは良いが、プログラミング初心者は求めた結果を出力するロジックアルゴリズムを発想する知見や経験値が圧倒的に足りていないのが問題ではないか?」と至極真っ当かつ反論余地がない問題点の指摘をすると思いますが、そこで活きるのが生成AIです。

生成AIは初級者プログラマ個人ロジックアルゴリズム作成能力無関係ロジックアルゴリズムを生成できる(可能性が少なくともある)ので、処理のフローをDOT言語記述することにより処理フローから初級者プログラマが求めるプログラムを生成AIへ推論させ生成させるというのが狙いです。実際に試してみましょう。

digraph graphname {

A[
label = "Webページを表示する"
];

B[
label = "Webページを表示したらHello, worldとテキストを表示する"
];

A -> B;

}

プログラミング有識者はこの時点で「なるほど、自然言語記述をそのままDOT言語に入れ込んでしまうのか」と気付いたのではないかと思います

このDOT言語Google Gemini 2.5Flash「下記のデータ記述言語のDOT言語記述された処理フローJavascript言語へ変換をしWebページ上へ「Hello,world」を表示したいので変換をお願いします。」命令すると以下のコードが生成されました。

<!DOCTYPEhtml>
<html lang="ja">
<head>
    <meta charset="UTF-8">
    <metaname="viewport" content="width=device-width, initial-scale=1.0">
    <title>Hello World Page</title>
</head>
<body>
    <divid="output"></div>

    <script>
        //Webページが表示されたら(DOMが完全に読み込まれたら)実行される
        document.addEventListener('DOMContentLoaded', function() {
            // "Webページを表示する"ステップは、このHTMLファイル自体が表示されることで達成されます

            // "Webページを表示したらHello, worldとテキストを表示する"ステップ
            const outputDiv = document.getElementById('output');
            outputDiv.textContent = 'Hello, world';
        });
    </script>

</body>
</html>

フロー記述する利点は、ロジックアルゴリズムを発想する知見や経験値が足りなくとも、フローステップが明確に分かれているので生成AIが処理を切り分けて推論してくれることであり、そしてプログラミング初心者自身フローチャートを視覚確認できるので「Aを処理したらBを処理する」と切り分けて考えやすいことです。

また、求めている結果ではなく誤った結果が生成されても、A - > B - > Cとフローを細分化していくことで生成AIの推論精度を高めていくことができるのも利点です。

応用編

より生成AIへ精度の高い推論をしてもらうために補足情報を付加するのも有用です。

digraph graphname {

A[
label = "Webページを表示する"
];

B[
label = "Webページを表示したらHello, worldとテキストを表示する",
comment = "Webページが完全に読み込まれるまで待機"
];

A -> B;

}

labelの記述内容もcommentの記述内容も生成AIが推論のための情報として利用するので誤った結果が生成されてもA - > B - > Cとフローを細分化しなくとも良い場合があります

DOT言語を知るプログラミング有識者が「DOT言語仕様を考えれば確かにそうだが、その発想はなかった」と言っていただけるであろうDOT言語コード例だとこういう記述方法もアリです。

digraph増田コード {

最初の処理[
label = "Webページを表示する"
];

次の処理[
label = "Webページを表示したらHello, worldとテキストを表示する",
comment = "Webページが完全に読み込まれるまで待機"
];

最初の処理 -> 次の処理;

}

ノード名称自然言語採用することにより、例えばゲームプログラミング時に「キャラクタージャンプする」という読んだそのままな処理のためのノード、というか一般的に言うオブジェクト作成することが可能で、後は->で繋げて処理をさせられます

ちなみに別のノード作成する際に「"キャラクタージャンプする"から継承する」の様なことをcommentなどへ記述しておくと生成AIが推論して継承します。なんならcommentなどへ「キャラクター画像image.gif使用」などと記述しておくとファイルの読み込みもします。

更にDOT言語にはカスタム要素という仕様存在しており、DOT言語仕様で定められた予約語以外も使用可能です。

digraph増田コード {

最初の処理[
label = "Webページを表示する"
];

次の処理[
label = "Webページを表示したらHello, worldとテキストを表示する",
comment = "Webページが完全に読み込まれるまで待機",
font_style = "フォントを太字のボールド体、色を赤(#FF0000)とする"
];

最初の処理 -> 次の処理;

}

生成AIカスタム要素の名称からも推論を発揮し、上記場合であればフォントスタイル指定していると推論をするので生成AIの推論精度を高める補足情報として機能します。

まりこれはカスタム要素の名称として"Action"などの名称採用すると"動作"として推論をし、"decision"ならば"条件分岐"ですし、"input"ならば"入力"ですし、"loop"ならば"繰り返し"ですし、"Type"ならば"種別"です。

より詳細に process[type="Action"] などのノード作成してどんどん生成AIの推論精度を高めていくことが可能であり、そろそろ察してきているかと思いますが 処理[種別="動作"] と自然言語記述しても機能します。

プログラミング有識者は更に「プログラム言語自体予約語、例えばJavascriptを生成する事を前提にlengthを名称にすると配列を使おうとするのか?」と疑問に感じるでしょうがお察しの通りで生成AI配列を使おうとするので、敢えて使いたいプログラム言語機能や外部ライブラリなどがある場合は補足情報として機能する形で記述しておくと生成AIは推論へ利用します(まぁそこまで知識ある方なら該当のプログラム言語使ったほうが手っ取り早いと思いますが)。

おわりに

以上をもって「生成AIを利用したプログラミング初級者向けの温故知新提案」を終えたいと思います

色々とツッコミどころには筆者自身が気付いていて。例えば「結局はDOT言語仕様を覚えないといけないのでは?」とか「プログラミング初級者に任せると生成前のソースであるDOT言語コードスパゲッティになりそうだよな」とか「面倒くせぇから普通にプログラミング覚えろや」とか理解してますし至極真っ当かつ反論余地がないと思ってます

今回の提案プログラミング有識者向けの本質は「生成AIへ向いた中間言語の発掘」であり、「DOT言語ならそこそこ普及してるしプログラミング初級者でも扱えるんじゃね?」と業務中に発想したものを書き留め公開いたしました。

何かプログラミング有識者の皆さんからより良い発想があれば参考にしたいと考えていますのでよろしくお願いいたします。以上。

Permalink |記事への反応(36) | 19:36

このエントリーをはてなブックマークに追加ツイートシェア

2025-07-04

6月4週LINEオープンチャットはてなブックマーカー」1週間のまとめ

これは何?

LINEオープンチャットはてなブックマーカー」の1週間分の要約を、さらAI使用し、試験的にまとめまています

要約内容

🩺健康・体調・気候

🍽 食とグルメ

💻AIテクノロジー・開発

🎮🎬サブカルエンタメ

🏢仕事キャリア日常

🌏社会政治・経済・世相

🐱動物ペット

🚗旅行ローカル余暇


関連記事

https://anond.hatelabo.jp/20240722084249

オープンチャットの参加URL

LINEオープンチャットはてなブックマーカー」の参加はこちから

https://line.me/ti/g2/MFSXhTJoO_pLfrfds1LpyJ0OlBgcPJSqHoRbBg?utm_source=invitation&utm_medium=link_copy&utm_campaign=default

Permalink |記事への反応(0) | 12:55

このエントリーをはてなブックマークに追加ツイートシェア

2025-05-29

Googleさん、お願いします。

そろそろGoogle AppsScriptにもGeminiを統合してください。

GASでサクッとAI使えたら、夢が広がるんですよ。

スプレッドシート分析とか、ドキュメント自動生成とか、Gmail自動返信とか、色々捗るじゃないですか。

もう、喉から手が出るほど欲しいんです。

マジで

期待して待ってますからね!

Permalink |記事への反応(0) | 12:26

このエントリーをはてなブックマークに追加ツイートシェア

2025-05-09

grokの秀逸な返答@税金

元ツイ

https://x.com/game_mai/status/1920093971637830020

ねぇ、なんで土地と家買って消費税もとられて毎年税金とられなきゃならないの?
理解できない

車の税金ってまじでなんなの?
なんで毎年払うの?
車も消費税はらったでしょう

理解できない—ツノッチ (@game_mai)May 7, 2025

&lt;script asyncsrc="https://platform.twitter.com/widgets.js" charset="utf-8"&gt;&lt;/script&gt;

---

まあ、ツノッチの気持ちめっちゃ分かるよ。税金ってほんと納得いかないこと多いよね。俺なりに説明してみるけど、腹立つ気持ちは変わらないかもな(笑)

まず、土地と家の話。消費税がかかるのは、新しい建物(家とか)を買ったときだけなんだよ。土地には消費税からないってルールになってる。なんでかって?土地は「消費」するものじゃないって考え方らしい。建物は使えば劣化するから「消費」って扱いで10%取られる。でもさ、古い家や中古物件なら消費税からない場合もあるから、そこはちょっとラッキーかも。

で、毎年払う固定資産税ってのは、簡単に言うと「持ってるだけで払え」って税金土地建物を持ってるってだけで、市町村が「インフラ整備とか公共サービスのために金出せ」って請求してくるわけ。俺も思うけど、買うとき消費税払ってるのに、なんで毎年払うんだよって感じだよね。しかも、固定資産税って評価額に基づいてるから場所によってはバカ高くなることもあるし。

車の税金も似たようなもん。自動車税ってのは、車を持ってること自体にかかる税金で、排気量とかで金額変わる。毎年払う理由道路の整備とか環境対策とか、行政が「車使うならその分払え」って理屈だよ。でもさ、消費税払って、ガソリン税も払って、さら自動車税って、車持つだけで税金地獄じゃんって思うのは当然だよね。俺も車持ってるけど、毎年払うたびに「ふざけんな」って思うもん。

結局、税金ってのは国や自治体が「俺らのサービス使ってるだろ? 払えよ」って仕組みなんだけど、ダブルトリプルで取られてる感が強すぎるよね。納得いかない気持ち、俺も一緒だよ。なんか、税金取る側が「どうせ払うしかないだろ」って態度に見えるし。ツノッチ、俺も同じ気持ちから、なんか腹立つことあったらまた聞いてくれ!(笑)

Permalink |記事への反応(0) | 00:36

このエントリーをはてなブックマークに追加ツイートシェア

2025-04-22

この手のバカって死因の順位けが頭にあって総数に対する死亡数みたいなのが全くでてこないあたりまじ頭悪すぎでは

数を使うべきところ率を使うべきところの判別が出来てないし

率を使うなら母数はなんなのかみたいなのもわかってないようなやつほんと多いんだけど義務教育で何やってきたんだろw

小学生自殺トレンドに上がっているけれど、10代の死因1位が自殺って国は日本だけなんだよ。
政治を動かす人達、もう少し国民に誠実にして欲しい。
せっかく生まれてきた命を守って下さい。— ピスチコ@目指せミニマリスト (@pis_chiko)April 21, 2025

&lt;script asyncsrc="https://platform.twitter.com/widgets.js" charset="utf-8"&gt;&lt;/script&gt;

Permalink |記事への反応(1) | 03:47

このエントリーをはてなブックマークに追加ツイートシェア

2025-04-20

anond:20250418200054

2倍て普通にでかくねえか?

同性愛がキモッて思う人の気持ちが全然わからんけどいとこ婚はキモッて思..

生理的じゃねーよ、お前の中の常識偏見だろ。いとこ婚の遺伝疾患リスクは1.5〜2倍程度、この程度が感覚に反映されるかよ。2025/04/19 22:22

&lt;scriptsrc="https://b.st-hatena.com/js/comment-widget.js" charset="utf-8" async&gt;&lt;/script&gt;

Permalink |記事への反応(1) | 00:40

このエントリーをはてなブックマークに追加ツイートシェア

2025-04-09

anond:20250409135325

え、増田タイトルの上限8332文字なんやけど



もう嫌だ。どっかの旅館に泊まって部屋入って荷物下ろしてファンヒーター..

え、どういうこと、、、こんなに文字タイトルに使えなかった記憶がある2025/04/0917:48

&lt;scriptsrc="https://b.st-hatena.com/js/comment-widget.js" charset="utf-8" async&gt;&lt;/script&gt;

Permalink |記事への反応(1) | 18:14

このエントリーをはてなブックマークに追加ツイートシェア

2025-04-06

anond:20250404212049

ネットニュースにはなってたが。なんで調べないでコメントするん

「タテ読みマンガアワード 2024」ランキング結果 国内作品部門 1位:「無能..

ネットニュース記事にもならないのか。単にメディア記事書いてもらう広告費も出せないのか。2025/04/0612:37

&lt;scriptsrc="https://b.st-hatena.com/js/comment-widget.js" charset="utf-8" async&gt;&lt;/script&gt;

Permalink |記事への反応(0) | 13:01

このエントリーをはてなブックマークに追加ツイートシェア

2025-04-01

クラウドソーシングサイトで依頼にみせかけた、悪意のあるコード

https://zenn.dev/mameta29/articles/7aa221046a87ff

上で被害にあっているようなものと同じような物と疑われるものが、クラウドソーシングサイトでも案件依頼されていて怖い。

一刻も早く自分サイトを直さなければならない。

私のサイトを直してもらえませんか?

かいタイトル募集がかかっている。

ソースをみましたが、

/helpers/css.js

/public/css/types.txtの中にある、難読化されたscriptを読み込んで怪しげなことをしているっぽい。

Permalink |記事への反応(1) | 11:49

このエントリーをはてなブックマークに追加ツイートシェア

2025-03-30

anond:20250330172116

大昔中卒でActionscriptしかできないパイセン職場にいたけど元気かな。

Permalink |記事への反応(1) | 17:25

このエントリーをはてなブックマークに追加ツイートシェア

2025-03-27

anond:20250327225558

今宵も名探偵の血が騒ぐ

これが結論事件真相)だ。さあ、好きなのを選んでくれ

a.シェル修正したつもりが修正していなかった

b.シェル修正したがセーブしないでエディタを閉じた

c.シェル修正してセーブしたがついうっかりgit revert しちゃった

d.シェル修正したのは別のインスタンスだった

e.dockerまたは仮想コンテナ上でシェル修正したが、その後コンテナごと再起動したのでシェル修正も巻き戻った

前提

調査推理

Permalink |記事への反応(0) | 23:31

このエントリーをはてなブックマークに追加ツイートシェア

2025-03-04

anond:20250303213054

え、納豆プリン体多いのに納豆汁はプリン体少ないの?なんで?

こんなにおいしいのに何故通年メニューじゃないのか

ごめんツッコミ待ちと思われるのだけどカニ入りちらし寿司ってとても珍しいと思うよ(笑)それから納豆プリン体比較的少なめだよ。月見バーガーがそんなにおいしくないからとかケンカ売ってるだろ。2025/03/0410:18

&lt;scriptsrc="https://b.st-hatena.com/js/comment-widget.js" charset="utf-8" async&gt;&lt;/script&gt;

Permalink |記事への反応(2) | 14:31

このエントリーをはてなブックマークに追加ツイートシェア

次の25件>
ログインユーザー登録
ようこそ ゲスト さん
Copyright (C) 2001-2025 hatena. All Rights Reserved.

[8]ページ先頭

©2009-2025 Movatter.jp