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 function onEnterFrame(event:EnterFrameEvent):void { | |
const distance : Number = event.passedTime * velocity; | |
const reelHeight : Number = boxSize * boxes.length; | |
//0 ile reel height arasinda gidip geliyor... | |
totalDistance = (totalDistance + distance ) % reelHeight; | |
for (var i:int = 0; i<boxes.length; i++) { | |
boxes[i].y = (boxStartY + totalDistance + (i * boxSize) ) % reelHeight; | |
} |
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 function onEnterFrame(event:EnterFrameEvent):void { | |
const moveBy:Number = event.passedTime * velocity; | |
const numBoxes:int = boxes.length; | |
var box:Quad; | |
for (var i:int = 0; i < numBoxes; i++) { | |
box = boxes[i]; | |
if (box.y >= boxEndY) { | |
var topBox:Quad = boxes[(i + 1) % numBoxes]; | |
box.y = topBox.y - boxSize; | |
} |
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
Runnable runnable = new Runnable() { | |
public void run() { | |
// do something... | |
} | |
}; | |
Thread thread = new Thread(runnable); | |
// 1. Thread run metodunu cagirirsan runnable current thread (thread.run()'i cagiran) icinde calisir. | |
// Bazen Unit test yazarken run metodunu cagiriyoruz. bu sayede Runnable icindeki islemler senkron yapilmis oluyor. | |
// run() metodundan cikildiginda run metodu icindeki islemlerin yapildigindan eminiz. |
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
# [PackageDev] target_format: plist, ext: tmLanguage | |
--- | |
name: GinRummyLog | |
scopeName: gin.log | |
fileTypes: [ginlog] | |
uuid: 786ded00-92e4-4105-a21a-fd030af63c5a | |
patterns: | |
- name: text.command | |
match: \"command\":[0-9]{4} |
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
<!-- GinRummy --> | |
<dict> | |
<key>scope</key> | |
<string>gin.log text.command</string> | |
<key>settings</key> | |
<dict> | |
<key>foreground</key> | |
<string>#F7860A</string> | |
<key>fontStyle</key> | |
<string>bold</string> |
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 class GameLogicTest { | |
[TestFixtureSetUp] | |
public void Init() { | |
//Init runs once before running test cases. | |
} | |
[TestFixtureTearDown] | |
public void CleanUp() { | |
//CleanUp runs once after all test cases are finished. | |
} |
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
import sys | |
import re | |
import datetime | |
REGEX = "([0-9]{8} [0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3})(.*)"; | |
shiftSeconds = int(sys.argv[2]) | |
startTime = sys.argv[3] | |
startShifting = False | |
with open(sys.argv[1]) as fp: |
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
package codekata.observer; | |
public interface CountDownObserver { | |
void onStart(); | |
void onCountDown(long elapsed, long remaining); | |
void onFinish(); | |
} |
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
package codekata.observer; | |
public class CountDownTimerView implements CountDownObserver { | |
@Override | |
public void onStart() { | |
//play count down start animation | |
} | |
@Override | |
public void onCountDown(long elapsed, long remaining) { |
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
package codekata.observer; | |
import java.util.LinkedList; | |
import java.util.List; | |
public class CountDownTimer { | |
private static long ONE_SECOND = 1000L; | |
private long countDownMillis; | |
private long elapsedTimeSinceLastTick; | |
private long totalElapsedTime; |
OlderNewer