Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,39 +0,0 @@
|
|||
using Std;
|
||||
|
||||
class Main
|
||||
{
|
||||
|
||||
static function main()
|
||||
{
|
||||
var test = "1";
|
||||
for (i in 0...11) {
|
||||
Sys.println(test);
|
||||
test = lookAndSay(test);
|
||||
}
|
||||
}
|
||||
|
||||
static function lookAndSay(s:String)
|
||||
{
|
||||
if (s == null || s == "") return "";
|
||||
|
||||
var results = "";
|
||||
var repeat = s.charAt(0);
|
||||
var amount = 1;
|
||||
for (i in 1...s.length)
|
||||
{
|
||||
var actual = s.charAt(i);
|
||||
if (actual != repeat)
|
||||
{
|
||||
results += amount.string();
|
||||
results += repeat;
|
||||
repeat = actual;
|
||||
amount = 0;
|
||||
}
|
||||
amount++;
|
||||
}
|
||||
results += amount.string();
|
||||
results += repeat;
|
||||
|
||||
return results;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue