Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

KT_Zheng ZiKT1229

🎯
Focusing
View GitHub Profile
@ZiKT1229
ZiKT1229 / README.md
Created Nov 6, 2018 — forked from straker/README.md
Basic Snake HTML Game
View README.md

Basic Snake HTML Game

Snake is a fun game to make as it doesn't require a lot of code (less than 100 lines with all comments removed). This is a basic implementation of the snake game, but it's missing a few things intentionally and they're left as further exploration for the reader.

Further Exploration

@ZiKT1229
ZiKT1229 / queue
Last active Jul 25, 2018
stack and queue with c++
View queue
#include <iostream>
#include <queue>
using namespace std;
int main()
{
queue<int> myQueue;
for (int i=0; i<5; i++)
myQueue.push(i); //放數字進去
@ZiKT1229
ZiKT1229 / ExampleOne
Created Jul 9, 2018
BinarySearchExample
View ExampleOne
void binarySearch(int array[], int aim)
{
int left=0, right=array_size-1, mid, ans;
while (left<=right)
{
mid=(left+right)/2;
if (array[mid]<aim)
left=mid+1;
else if (array[mid]>aim)
right=mid-1;
@ZiKT1229
ZiKT1229 / ExampleOne
Last active Jul 25, 2018
linearSearchExample
View ExampleOne
void linearSearch(int array[])
{
for (int i=0; i<array_size; i++)
if (array[i]==5)
cout<<array[i];
}