Skip to content

Instantly share code, notes, and snippets.

View lasagnaphil's full-sized avatar

Phil Chang lasagnaphil

View GitHub Profile
@lasagnaphil
lasagnaphil / configure.py
Created November 23, 2022 02:14
Example code for using build system
from tools.fbuild import Project, Compiler, ExternalLibrary, HeaderOnlyLibrary, ObjectList, Executable, Copy, Alias
project = Project(name="flock3d", platform="windows")
lib_vulkan = ExternalLibrary(
name="vulkan",
basepath="C:/VulkanSDK/1.3.216.0",
includes=["Include"],
defines=["VULKAN_HPP_NO_EXCEPTIONS"])
{
"L_Abductor_Pollicis_Longus": [
"R_Radius",
"R_H_Metacarpal_1"
],
"R_Abductor_Pollicis_Longus": [
"R_Radius",
"R_H_Metacarpal_1"
],
"L_Adductor_Brevis": [
@lasagnaphil
lasagnaphil / build_libtorch.sh
Last active May 11, 2024 02:36
Build libtorch from scratch
# Script for installing libtorch from scratch (without any python dependencies)
# This clones the ``pytorch`` folder in the current directory, creates a ``pytorch-build`` directory containing all the intermediate files for building, and creates a ``pytorch-install`` folder for storing the compiled library.
# After the build, you can use it by setting ``CMAKE_PREFIX_PATH=(path to pytorch-install folder)``.
# Note that you need to have all the dependencies needed before running this script! (Read README.md in the main pytorch repo)
git clone --recursive https://github.com/pytorch/pytorch -b v1.7.1 --depth 1
mkdir -p pytorch-build
mkdir -p pytorch-install
pushd pytorch-build
@lasagnaphil
lasagnaphil / parse.py
Last active December 2, 2019 12:37
Extract categories from CMU
import pandas as pd
table = pd.read_csv('cmu-mocap-index-spreadsheet.csv', sep='\t')
table = table.dropna(axis=0)
table.columns = ['Motion', 'Description', 'Subject']
categories = [
'walk', 'run|jog', 'jump', 'dance', 'sit', 'climb', 'balance', 'hop', 'stretch', 'flip',
'basketball', 'soccer', 'boxing',
'drink', 'wash windows', 'bend', 'cartwheel',
@lasagnaphil
lasagnaphil / factorial.c
Last active October 12, 2019 09:38
factorial.c
int factorial(int n) {
if (n == 0) return 1;
else return n * factorial(n - 1);
}
#include <stdio.h>
int main(int argc, char** argv) {
int offset;
char c;
scanf("%d\n", &offset);
while (scanf("%c", &c) != EOF && c != '\n') {
printf("%c", 'A' + ((c - 'A' + offset) % 26));
}
return 0;

코드 리뷰

플레이 후기

  • PPT 정말 잘 만들었습니다. 메카닉이 단번에 이해가 가는군요
  • 잘못된 인풋을 넣었더니 갑자기 메세지박스가 떠서 놀랐습니다. 나중에 코드를 보니 WinForms을 잘 찾아 쓴것 같군요...
  • 실제로 게임을 좀 더 해봤더니, 플레이어 중 한 명이 바보가 아닌 이상 승부가 쉽게 나지 않는것 같습니다. 이 이유 때문에 데스매치 메카닉을 넣은 것 같지만, 일단 데스매치가 나올 때 까지 기다리는 것이 좀 지루한 것 같습니다. 그래서 좀 더 재밌는 게임이 되려면 기본 메카닉에 좀 더 수정을 가해야 할 것 같습니다.

...하지만 여기는 기획 스터디가 아니므로, 바로 프로그래밍으로 넘어가도록 하죠 ㅎㅎ

using System;
public class Program
{
public static void Main()
{
bool[,] board = new bool[5, 5]
{
{ true, false, false, true, false },
@lasagnaphil
lasagnaphil / lec7_practice.cs
Created May 12, 2019 06:23
7강 실습 답
using System;
public class Program
{
class Vector2
{
public float X;
public float Y;
public Vector2(float X, float Y)
@lasagnaphil
lasagnaphil / lec5_hw.cs
Created May 11, 2019 17:21
5강 과제 답
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace lec5_hw
{
class Program
{