Skip to content

Instantly share code, notes, and snippets.

View ryuchan00's full-sized avatar

Ryutaro Yamakawa ryuchan00

View GitHub Profile
@ryuchan00
ryuchan00 / uno.py
Created January 5, 2026 01:03
UNOの深層学習
# coding: utf-8
# DQN(Deep Q-Network)によるUNOゲームの強化学習
# PyTorchを使用して、AIエージェントがUNOのような簡易カードゲームを学習する
# 強化学習:環境と相互作用しながら、報酬を最大化する行動を学習する機械学習手法
# DQN:Q学習にディープニューラルネットワークを組み合わせた手法
import torch # PyTorch:ディープラーニングフレームワーク
import torch.nn as nn # ニューラルネットワークモジュール
import torch.optim as optim # 最適化アルゴリズム
import numpy as np # 数値計算ライブラリ
@ryuchan00
ryuchan00 / block.pde
Created August 16, 2020 10:35
ブロック崩し
final int numBlocksCols = 5, numBlocksRows = 10;
final int numBlocks = numBlocksCols * numBlocksRows;
final int blockWidth = 30, blockHeight = 10, space = 2;
final int padWidth = 40, padHeight = 10;
final color std_colors[] = {color(255, 0, 0) // red
, color(255, 0, 255) // magenta
, color(255, 255, 0) // yellow
, color(0, 255, 255) // cyan
, color(0, 255, 0) // green
};
@ryuchan00
ryuchan00 / circleStars.pde
Created May 23, 2020 01:59
シンガポール🇸🇬みたいな円状に均等に星を配置するやつ
// 🇸🇬
size(120, 120);
background(255);
noStroke();
fill(152, 251, 152);
int a[] = {1,4,2,5,3};
int b;
float x;
float y;
@ryuchan00
ryuchan00 / easyStar.pde
Created May 23, 2020 01:26
簡単なロジックで星を作る
size(60, 60);
background(255);
noStroke();
fill(152, 251, 152);
int b;
int a[] = {1,4,2,5,3};
beginShape();
for (int i = 0; i < 5; i++) {
#include <stdio.h>
int main(void)
{
int i = 0;
// 今は入力値は101を与えてあげる。出力は1が文字列中に2つなので2になる
char *str = "101";
int counter = 0; // strに1が何回あるか数える変数
while (※strの文字列の長さの回数繰り返す)
{
#include <stdio.h>
int main()
{
int a, b, c;
a = 1;
b = 2;
c = 3;
char s[101];
s = 'test';
// 整数の入力
@ryuchan00
ryuchan00 / .Xmodmap
Created May 18, 2019 00:19
caps lockをcontrolと入れ替える
remove Lock = Caps_Lock
keysym Caps_Lock = Control_L
add Control = Control_L
load A
sub B
ifp ABig
ifn BBig
ABig:load A
store Z
jump CompC
BBig:load B
store Z
jump CompC
@ryuchan00
ryuchan00 / sample_app_deploy.sh
Created March 28, 2018 05:01
Deploying SampleApp to Dokku.
# [Dokku - The smallest PaaS implementation you've ever seen](http://dokku.viewdocs.io/dokku/deployment/application-deployment/#deploying-to-dokku)
# login root user.
dokku apps:create ruby-rails-sample
# install the postgres plugin
# plugin installation requires root, hence the user change
dokku plugin:install https://github.com/dokku/dokku-postgres.git
# create a postgres service with the name rails-database
@ryuchan00
ryuchan00 / install_dokku.sh
Last active March 28, 2018 04:45
Install dokku script.
# [Dokku - The smallest PaaS implementation you've ever seen](http://dokku.viewdocs.io/dokku/getting-started/installation/)
# for debian systems, installs Dokku via apt-get
cd ~/
wget https://raw.githubusercontent.com/dokku/dokku/v0.11.6/bootstrap.sh
sudo DOKKU_TAG=v0.11.6 bash bootstrap.sh