This file contains hidden or 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 UnityEngine; | |
| using System.Collections; | |
| using System.Collections.Generic; | |
| [RequireComponent (typeof (UnityEngine.AI.NavMeshAgent))] | |
| public class Enemy : LivingEntity { | |
| #region AI |
This file contains hidden or 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
| def count(A): | |
| result = False | |
| for i in A: | |
| result += i | |
| return result | |
| def solution(A,X): | |
| if (X > len(A)): | |
| return -1 | |
| seen = [False] * X |
This file contains hidden or 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
| def solution(X,Y,D): | |
| d = Y-X | |
| a = d//D | |
| if (d%D > 0): | |
| a +=1 | |
| return a | |
| x=10 |
This file contains hidden or 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
| def solution(A): | |
| A.sort() | |
| x = 0 | |
| l = len(A) | |
| while x < l: | |
| print(x) | |
| if (x == l-1): | |
| print('returning ',A[x]) |
This file contains hidden or 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
| def solution(A,K): | |
| l = len(A) | |
| if (l == 0): | |
| return A | |
| if (K>l): | |
| K = K % len(A) | |
| x = A[:l-K] |
This file contains hidden or 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
| def solution(N): | |
| cnt = 0 | |
| result = 0 | |
| found_one = False | |
| i = N | |
| while i: | |
| print 'i is : ', i | |
| if i & 1 == 1: |
This file contains hidden or 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.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| using UnityEngine.UI; | |
| public class ScrollRectSnap : MonoBehaviour | |
| { | |
| public RectTransform panel;//Holds scrollPanel | |
| public Button[] button; | |
| public RectTransform center; //Center to compare the distance for each button |
This file contains hidden or 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.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| using UnityEngine.UI; | |
| public class PhoneCamera : MonoBehaviour | |
| { | |
| private bool camAvailable; | |
| private WebCamTexture backCam; | |
| private Texture defaultBackground; |
This file contains hidden or 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
| from os import listdir # to display available input files | |
| import heapq # for priority queue | |
| import math | |
| from time import time # for run times | |
| import matplotlib.pyplot as plt # to display solutions | |
| import numpy as np #for polygon | |
| %matplotlib inline | |
| print('Available input files:') | |
| dataDir = 'data2' # directory with input files |
This file contains hidden or 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
| # defmodule FizzBuzz do | |
| # def upto(n) when n > 0 do | |
| # 1..n |> Enum.map(&fizzbuzz/1) | |
| # end | |
| # | |
| # defp fizzbuzz(n) when rem(n, 3) == 0 and rem(n, 5) == 0, do: "FizzBuzz" | |
| # defp fizzbuzz(n) when rem(n, 3) == 0, do: "Fizz" | |
| # defp fizzbuzz(n) when rem(n, 5) == 0, do: "Buzz" | |
| # defp fizzbuzz(n), do: n | |
| # end |