Skip to content

Instantly share code, notes, and snippets.

Ch001 Part003

Ch001 Part002

Ch001 Part001

FROM microsoft/dotnet:1.0-sdk-msbuild
WORKDIR /app
# copy fsproj and restore as distinct layers
COPY dotnetapp.fsproj .
RUN dotnet restore
# copy and build everything else
COPY . .
RUN dotnet publish -c Release -o out
@ApprenticeGC
ApprenticeGC / cellular_automata_cave_partial_01.fsx
Last active March 3, 2017 09:23
Cellular Automata cave generation first try
type CellStatus =
| Dead
| Alive
type Cell = {
status : CellStatus
}
type RuleContext = {
regenerateMin : int
@ApprenticeGC
ApprenticeGC / game_of_life_partial01.fsx
Last active March 2, 2017 04:35
Conway’s Game of Life
type CellStatus =
| Dead
| Alive
type Cell = {
status : CellStatus
}
let changeCellStatus cell surrounding =
let status' =
@ApprenticeGC
ApprenticeGC / UnityKeyCombo.cs
Created December 28, 2016 08:45
Combo Simulation without time abort
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UniRx;
public class Combo : MonoBehaviour
{

連線RPG

連線需求

當玩家開啓客戶端後會進行驗証並於完成後將其所屬的資料取回,呈現於客互端。而在一定時間閒置後,玩家的資料也會隨著玩家重新遊玩時進行和伺服器端資料同步的動作。同步後的資料會被暫存於客戶本地端,做UI的呈現使用,但玩家每次重要的動作仍需回送到伺服器,並以伺服器的資料為主。

@ApprenticeGC
ApprenticeGC / Snake Game Game Rule.md
Last active July 6, 2017 03:59
Game rule of snake game that evolves as design changes.

Snake遊戲規則

在一空間中可做四方向的移動,每次移動會以一個單位為距離。在移動的當下,若是有吃到食物,則蛇會多增加一個單位的大小。整個空間中只會有一個食物和一條蛇,當該食物被蛇吃掉後,食物又會出現在此空間中的任一位置。為了要讓蛇在移動時,在有限的空間中進行,此空間是有邊界的,當蛇觸碰到邊界時則死亡,遊戲也會在此結束。

class MainActivity : AppCompatActivity() {
// All necessary variables defined here
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
var rxBleClient = RxBleClient.create(this)