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
; じゃんけん | |
; 仕様: | |
; 1 Rock (グー) | |
; 2 Scissors (チョキ) | |
; 3 Paper (パー) | |
(setf *random-state* (make-random-state t)) | |
(print "じゃんけんゲーム\n選択肢はグー・チョキ・パーそれぞれ、1から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
{ | |
"Backquote": { | |
"type": "common", | |
"char": "`" | |
}, | |
"Backslash": { | |
"type": "common", | |
"char": "\\" | |
}, | |
"BracketLeft": { |
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
use std::mem::MaybeUninit; | |
use windows::{ | |
Win32::{ | |
Foundation::*, | |
Graphics::Dwm::*, | |
UI::{HiDpi::GetDpiForWindow, WindowsAndMessaging::*}, | |
}, | |
core::*, | |
}; |
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
unsafe fn build_ns_toolbar_delegate_class() -> *const Class { | |
let mut decl = ClassDecl::new("SampleToolbarDelegate", class!(NSObject)).unwrap(); | |
decl.add_protocol(Protocol::get("NSToolbarDelegate").unwrap()); | |
fn get_toolbar_identifier() -> id { | |
unsafe { NSString::alloc(nil).init_str("SampleToolbarItem") } | |
} | |
extern "C" fn toolbar_identifier(_this: &Object, _: Sel, _toolbar: id) -> id { |
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
{ | |
"account_closed": "お客様の銀行口座は閉鎖されています。", | |
"account_country_invalid_address": "指定された事業住所の国がアカウントの国と一致しません。", | |
"account_error_country_change_requires_additional_steps": "アカウントの国を変更するには追加の手続きが必要です。", | |
"account_information_mismatch": "アカウント情報の一部に矛盾があります。", | |
"account_invalid": "指定されたアカウントIDが無効です。", | |
"account_number_invalid": "口座番号が無効です(桁数不足など)。", | |
"acss_debit_session_incomplete": "ACSSデビットセッションが完了していません。時間をおいて再試行してください。", | |
"alipay_upgrade_required": "このAlipay決済方法はサポートされなくなりました。Sourcesを使用するようにアップグレードしてください。", | |
"amount_too_large": "指定金額が上限を超えています。金額を下げて再度試してください。", |
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
from __future__ import annotations | |
__all__ = ("VoiceClientForGetEndpoint",) | |
from typing import TYPE_CHECKING | |
import discord | |
if TYPE_CHECKING: | |
from discord.types.voice import ( |
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
# 元のプログラム:https://web.archive.org/web/20231105011711/https%3A%2F%2Fdept.chs.nihon-u.ac.jp%2Fwp-content%2Fuploads%2Finformation_science%2F9cb5143e5ee68a9f9a519b578ca6cd76.pdf | |
# クラスで抽象化したりリストではなくビット演算で近傍を表現したりと改造した。画面の拡大縮小や移動もできる。 | |
from time import time | |
def get_neighborhood(width_, state, x): | |
"""指定された幅と状態そして位置から、近傍(三ビット分の整数)を取得します。 | |
もし端のセルで一ビット足りない状態となったのなら、足りないビットは0にします。""" | |
# 端を切り取っても三ビット分になるように調整を施す。 |
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
# 元のプログラム:https://web.archive.org/web/20230328052646/https://dept.chs.nihon-u.ac.jp/wp-content/uploads/information_science/27bb9764f6d3d05585e766a110f748ec.pdf | |
# 確か、クラスで抽象化したりした。なお、実際に自分が受験したのはこれの次。 | |
GRAVITY = 9.8 | |
COEFFICIENT_OF_RESTITUTION = 0.8 | |
FRICTION = 0.9 | |
BALL_NUMBER = 5 | |
BALL_SIZE = 30 |
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
use cacao::{ | |
appkit::{ App, AppDelegate, window::Window }, notification_center::Dispatcher, | |
view::{ View, ViewDelegate }, layout::{ Layout, LayoutConstraint }, | |
button::Button, text::Label | |
}; | |
enum ButtonType { Count, Reset } | |
type TypedApp = App<CountApp, ButtonType>; |
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
use psd::Psd; | |
use libui::{ | |
controls::{ Area, AreaHandler, AreaDrawParams }, | |
draw::{ Path, FillMode, Brush, SolidBrush } | |
}; | |
use itertools::Itertools; | |
NewerOlder