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
// Utility functions | |
function populateNumbers(startNum, endNum, missingNum) { | |
let numbers = []; | |
for (let i = startNum; i <= endNum; ++i) { | |
if (i !== missingNum) { | |
numbers.push(i) | |
} | |
} | |
return numbers; |
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
export CATALOG_URL=$(curl -s \ | |
--header "authorization: Basic $CCD_AUTH_KEY" \ | |
--header "content-type: application/json" \ | |
--request GET \ | |
--url "https://content-api.cloud.unity3d.com/api/v1/buckets/${CCD_BUCKET_ID}/entries/" | \ | |
jq -r '[[.[] | select(.path | contains(".json"))] | sort_by(.last_modified) | reverse[]] | .[0] | .content_link') | |
EXCLUDED_CONFIG_CONTENT=$(echo ${UNITY_REMOTE_CONFIG_CONTENT} | \ | |
jq \ |
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
public int[] GetStatusOfCellNeighbors(int xIndex, int yIndex) | |
{ | |
// Use x from left to right, y from bottom to top | |
// 2,0 2,1, 2,2 | |
// 1,0 1,1, 1,2 | |
// 0,0 0,1, 0,2 | |
(int, int)[] GetIndicesOfNeighbors() | |
{ | |
return new (int, int)[] |
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
private void Start() | |
{ | |
Assert.IsNotNull(gridCellPrefab); | |
for (var y = 0; y < height; ++y) | |
{ | |
for (var x = 0; x < width; ++x) | |
{ | |
var cellPosition = new Vector3(x, y, 0); | |
var createdInstance = GameObject.Instantiate(gridCellPrefab, cellPosition, Quaternion.identity); |
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
void Start() | |
{ | |
int GetAliveCountOfNeighbors(int[] neighbors) => neighbors.Aggregate(0, (acc, next) => acc + next); | |
{ | |
// 0 0 0 | |
// 0 1 0 | |
// 0 0 0 | |
var statusOfCurrentCell = 1; | |
var statusOfCurrentNeighbors = new[] {0, 0, 0, 0, 0, 0, 0, 0}; |
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
int GetNextGenerationStatus(int statusOfCurrentCell, int[] statusOfCurrentNeighbors) | |
{ | |
var count = statusOfCurrentNeighbors.Length; | |
var aliveNeighborCount = 0; | |
for (var i = 0; i < count; ++i) | |
{ | |
var statusOfCurrentNeighbor = statusOfCurrentNeighbors[i]; | |
if (statusOfCurrentNeighbor == 1) | |
{ | |
aliveNeighborCount += 1; |
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
namespace ConsoleApplication1 | |
{ | |
using System; | |
using System.Linq; | |
using System.IO; | |
using System.Text; | |
using System.Collections; | |
using System.Collections.Generic; | |
public class Solution |
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
var blessed = require('blessed') | |
const employeeWantedDataCollection = [ | |
{ | |
title: 'Game Programmer', | |
salary: 'NT 80000/Month', | |
description: 'Fluent in C++/C# and strong knowledge in Unity', | |
contact: 'hr@ubihard.com' | |
}, | |
{ |
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
const webpack = require('webpack') | |
module.exports = { | |
webpack: function (config) { | |
config.plugins.push( | |
new webpack.DefinePlugin({ | |
'process.env': { | |
S3_ACCESS_KEY: JSON.stringify(process.env.S3_ACCESS_KEY), | |
S3_SECRET_KEY: JSON.stringify(process.env.S3_SECRET_KEY) |
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
{ | |
"name": "PlayMaker", | |
"toSymlink": [ | |
{ | |
"name": "PlayMaker", | |
"to": "Standard Assets/PlayMaker" | |
}, | |
{ | |
"name": "Gizmos/PlayMakerFSM Icon.tiff", | |
"to": "Gizmos/PlayMakerFSM Icon.tiff" |
NewerOlder