This file contains 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
# include <Siv3D.hpp> // OpenSiv3D v0.6.6 | |
double safeDistance = 5.0; | |
double minDelta = 0.1; | |
struct Node; | |
struct Shape | |
{ | |
bool isSelected = false; |
This file contains 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
#include <iostream> | |
#include <vector> | |
#include <algorithm> | |
// gcc version 11.2.0 (Ubuntu 11.2.0-19ubuntu1) | |
int main() | |
{ | |
const std::vector<int> v = { 1, 4, 2, 5, 5, 2, 3, 5, 2, 3, 4, 6, 3, 2, 5, 1, 2, 3, 4, 5, 6, 5, 6 }; | |
std::vector<const int*> vp(v.size()); |
This file contains 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
using System.Linq; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using System; | |
public class FlagsManager : MonoBehaviour | |
{ | |
[SerializeField] int FieldSizeX = 50; | |
[SerializeField] int FieldSizeZ = 60; | |
[SerializeField] float TileSize = 2.0f; |
This file contains 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
using System.Linq; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using System; | |
public class FlagsManager : MonoBehaviour | |
{ | |
[SerializeField] int FieldSizeX = 50; | |
[SerializeField] int FieldSizeZ = 60; | |
[SerializeField] float TileSize = 2.0f; |
This file contains 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
class Ball | |
{ | |
bool enabled = false; | |
Vec2 position; | |
} | |
Ball balls[100]; | |
void update() | |
{ |
This file contains 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
# update | |
sudo apt update | |
sudo apt upgrade -y | |
# install packages | |
sudo apt install -y build-essential cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libdc1394-22-dev unzip libgl-dev libturbojpeg-dev libgl-dev libglu-dev libopenal-dev libogg-dev libvorbis-dev | |
# download | |
cd ~ |
This file contains 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
while (g_client.available()) | |
{ | |
// 全体の長さ | |
uint64 size = 0; | |
if (g_client.lookahead<uint64>(size) && g_client.available() >= size) | |
{ | |
g_client.skip(size); | |
Deserializer<MemoryWriter> reader; |
This file contains 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
#include "OpenSivSerial.hpp" | |
struct Arm | |
{ | |
double l1 = 150.0; | |
double l2 = 100.0; | |
Vec2 pos = Vec2(200.0, 200.0); | |
Vec2 delta = Vec2(10.0, 0.0); | |
void draw(double a1, double a2) |
This file contains 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
# include <Siv3D.hpp> // OpenSiv3D v0.4.0 | |
void Main() | |
{ | |
RectF r1(100, 100, 300, 300); | |
RectF r2(50, 50, 50, 50); | |
RectF r3(150, 150, 50, 50); | |
Scene::SetBackground(Palette::Skyblue); |
This file contains 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
#pragma once | |
Array<Array<Vec2>> GetOutlines(const Image& image, function<bool(Color)> judge) | |
{ | |
const Point directions[8] = { { 1, 0 }, { 1, 1 }, { 0, 1 }, { -1, 1 }, { -1, 0 }, { -1, -1 }, { 0, -1 }, { 1, -1 } }; | |
const Rect rect(image.size()); | |
const int width = image.width(); | |
const int height = image.height(); | |
Grid<bool> map(width, height, false); | |
Array<Point> startPositions; |
NewerOlder