Created
May 7, 2020 19:55
-
-
Save Xaseron/5527e10f225823b99bf2a55db435fdb2 to your computer and use it in GitHub Desktop.
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
(function (root, factory) { | |
if (typeof define === 'function' && define.amd) | |
define(['exports'], factory); | |
else if (typeof exports === 'object') | |
factory(module.exports); | |
else | |
root.Kangle = factory(typeof Kangle === 'undefined' ? {} : Kangle); | |
}(this, function (_) { | |
'use strict'; | |
function Unit() { | |
Unit_instance = this; | |
{ | |
} | |
} | |
Unit.prototype.toString = function () { | |
return 'kotlin.Unit'; | |
}; | |
Unit.$metadata$ = { | |
simpleName: 'Unit', | |
kind: 'object', | |
interfaces: [] | |
}; | |
var Unit_instance; | |
function Unit_getInstance() { | |
if (Unit_instance == null) | |
new Unit(); | |
return Unit_instance; | |
} | |
function equals(obj1, obj2) { | |
if (obj1 == null) { | |
return obj2 == null; | |
}if (obj2 == null) { | |
return false; | |
}if (typeof obj1 === 'object' ? typeof obj1.equals === 'function' : false) { | |
return obj1.equals(obj2); | |
}if (obj1 !== obj1) { | |
return obj2 !== obj2; | |
}if (typeof obj1 === 'number' ? typeof obj2 === 'number' : false) { | |
var tmp; | |
if (obj1 === obj2) { | |
var tmp_0; | |
if (obj1 !== 0) { | |
tmp_0 = true; | |
} else { | |
var tmp0_asDynamic_0 = 1; | |
var tmp_1 = tmp0_asDynamic_0 / obj1; | |
var tmp1_asDynamic_0 = 1; | |
tmp_0 = tmp_1 === tmp1_asDynamic_0 / obj2; | |
} | |
tmp = tmp_0; | |
} else { | |
tmp = false; | |
} | |
return tmp; | |
}return obj1 === obj2; | |
} | |
function jsTypeOf(value_hack) { | |
var tmp0_unsafeCast_0 = typeof value_hack; | |
return tmp0_unsafeCast_0; | |
} | |
var counter; | |
var counterInterval; | |
function outOfTime() { | |
if (!equals(counterInterval, undefined)) { | |
return Unit_getInstance(); | |
}E.showMessage('Out of Time', 'My Timer'); | |
var tmp = Bangle.buzz(); | |
var tmp0_then_0 = tmp.then(outOfTime$lambda_0_KFunctionFactory()); | |
var tmp1_then_0 = outOfTime$lambda_1_KFunctionFactory(); | |
tmp0_then_0.then(tmp1_then_0); | |
Unit_getInstance(); | |
setTimeout(outOfTime_KFunctionFactory(), 10000); | |
Unit_getInstance(); | |
} | |
function countDown() { | |
{ | |
{ | |
var tmp0 = counter; | |
counter = tmp0 - 1 | 0; | |
tmp0; | |
} | |
} | |
Unit_getInstance(); | |
if (counter <= 0) { | |
clearInterval(counterInterval); | |
counterInterval = undefined; | |
setWatch(countDown$lambda_2_KFunctionFactory(), BTN2); | |
outOfTime(); | |
return Unit_getInstance(); | |
}g.clear(); | |
Unit_getInstance(); | |
g.setFontAlign(0, 0); | |
Unit_getInstance(); | |
g.setFont('Vector', 80); | |
Unit_getInstance(); | |
g.drawString('' + counter, 120, 120); | |
Unit_getInstance(); | |
g.flip(); | |
Unit_getInstance(); | |
} | |
function startTimer() { | |
counter = 30; | |
countDown(); | |
if (equals(counterInterval, undefined)) { | |
counterInterval = setInterval(countDown_KFunctionFactory(), 1000); | |
}} | |
function main() { | |
startTimer(); | |
} | |
function outOfTime$lambda_0(it) { | |
return Bangle.beep(200, 4000); | |
} | |
function outOfTime$lambda_1(it) { | |
return Bangle.beep(200, 3000); | |
} | |
function countDown$lambda_2() { | |
startTimer(); | |
} | |
var outOfTime$lambda_0_KFunctionFactory_$cache = null; | |
function outOfTime$lambda_0_KFunctionFactory() { | |
if (outOfTime$lambda_0_KFunctionFactory_$cache == null) { | |
var tmp = function (it) { | |
return outOfTime$lambda_0(it); | |
}; | |
tmp.callableName = 'outOfTime$lambda-0'; | |
outOfTime$lambda_0_KFunctionFactory_$cache = tmp; | |
}return outOfTime$lambda_0_KFunctionFactory_$cache; | |
} | |
var outOfTime$lambda_1_KFunctionFactory_$cache = null; | |
function outOfTime$lambda_1_KFunctionFactory() { | |
if (outOfTime$lambda_1_KFunctionFactory_$cache == null) { | |
var tmp = function (it) { | |
return outOfTime$lambda_1(it); | |
}; | |
tmp.callableName = 'outOfTime$lambda-1'; | |
outOfTime$lambda_1_KFunctionFactory_$cache = tmp; | |
}return outOfTime$lambda_1_KFunctionFactory_$cache; | |
} | |
var outOfTime_KFunctionFactory_$cache = null; | |
function outOfTime_KFunctionFactory() { | |
if (outOfTime_KFunctionFactory_$cache == null) { | |
var tmp = function () { | |
return outOfTime(); | |
}; | |
tmp.callableName = 'outOfTime'; | |
outOfTime_KFunctionFactory_$cache = tmp; | |
}return outOfTime_KFunctionFactory_$cache; | |
} | |
var countDown$lambda_2_KFunctionFactory_$cache = null; | |
function countDown$lambda_2_KFunctionFactory() { | |
if (countDown$lambda_2_KFunctionFactory_$cache == null) { | |
var tmp = function () { | |
return countDown$lambda_2(); | |
}; | |
tmp.callableName = 'countDown$lambda-2'; | |
countDown$lambda_2_KFunctionFactory_$cache = tmp; | |
}return countDown$lambda_2_KFunctionFactory_$cache; | |
} | |
var countDown_KFunctionFactory_$cache = null; | |
function countDown_KFunctionFactory() { | |
if (countDown_KFunctionFactory_$cache == null) { | |
var tmp = function () { | |
return countDown(); | |
}; | |
tmp.callableName = 'countDown'; | |
countDown_KFunctionFactory_$cache = tmp; | |
}return countDown_KFunctionFactory_$cache; | |
} | |
counter = 30; | |
counterInterval = undefined; | |
main(); | |
return _; | |
})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment