Skip to content

Instantly share code, notes, and snippets.

View youkidearitai's full-sized avatar

tekimen youkidearitai

View GitHub Profile
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": true
},
"profiles": [
{
"complex_modifications": {
"parameters": {
@youkidearitai
youkidearitai / gist:099e6b1067445eb394e333906e37209d
Last active November 26, 2020 04:18
Do-Re-Mi Game for Ichigojam
REM R=ランダムフラグ 0=イツモノ 1=ランダム
REM N=ツギヘノポインタ
1 N=10:R=1
2 IF SOUND()<>1 THEN GOTO 3 ELSE GOTO 2
3 IF R==0 THEN GOTO N ELSE GOTO 4
4 N=(RND(9)+1)*10:GOTO N
10 ?"ド":PLAY "C4D8E4C8 E4C4E2":N=20
11 GOTO 2
20 ?"レ":PLAY "D4E8F8 F8 E8 D8 F2":N=30
#!/usr/bin/env python
def ordinal_numeral_en(num):
one_hundred = num % 100
if one_hundred > 3 and one_hundred <= 20:
return "th"
if one_hundred % 10 == 1:
return "st"
#include <stdio.h>
int main(void) {
int i;
i = 10;
switch (i) {
case 1:
case 3:
printf("hello world: %d\n", i);
>>> print_cvs
Compiled variables count: 0

>>> print $eg
$9 = {
  uninitialized_zval = {
    value = {
      lval = 0,
      dval = 0,
{
sqlライブラリにプリペアドステートメントを追加しました。
Kuinの変数とデータベースとの間で読み書きができるようになります。
## 使い方
1. `[email protected]` でSQLを準備する。バインドしたい値がある場合、プレースホルダー `?`を設置する
2. `[email protected]*` を使って変数をセット(バインド)する
3. `[email protected]` or `[email protected]` メソッドでSQLの実行
+ `[email protected]` の場合は`while`文を利用して、0行を含むすべての行の取得ができるようになります
+func main()
{
sqlライブラリに、以下2つの機能を追加してみました。
### getBlob関数
func getBlob(col: int): []bit8
SQLiteではデータ型にBLOBが使えるため、Kuinの[]bit8で取得できるとバイナリを扱えるので作成しました。使い方としてはsql@getIntやsql@getFloat、sql@getStrでの使い方と同じように、列をcolで指定します。
const excptCalcErr: int :: 0x0001
var isErr: bool :: false
func main()
do \wnd_calc@show()
while(wnd@act())
end while
do \wnd_calc@close()
end func
func main()
var c: []char :: "-9223372036854775808"
var existed: bool
var title: []char :: c.toInt(&existed).toStr()
var i: int :: -9223372036854775808
do wnd@msgBox(null, "\{title} existed: \{existed.toStr()}", " overflow test ", %info, %ok)
end func
@youkidearitai
youkidearitai / blink_delay_sample.ino
Last active March 25, 2019 17:03
Arduino blink with Cth.h