@@ -44,10 +44,12 @@ TASK.new(function()
44
44
end )
45
45
46
46
SFX .load ({
47
- untick = ' untick.ogg' ,
48
- solve = ' solve.ogg' ,
49
- copy = ' copy.ogg' ,
50
- paste = ' paste.ogg' ,
47
+ tick = ' tick.ogg' ,
48
+ untick = ' untick.ogg' ,
49
+ solve = ' solve.ogg' ,
50
+ copy = ' copy.ogg' ,
51
+ paste = ' paste.ogg' ,
52
+ error = ' error.ogg' ,
51
53
})
52
54
53
55
FONT .load (' unifont' , ' unifont.otf' )
@@ -379,6 +381,92 @@ local gridConst = {
379
381
{ 0 , 0 , 1 , 0 , 0 },
380
382
{ 0 , 0 , 1 , 0 , 0 },
381
383
},
384
+ paste = {
385
+ dumpGrid {
386
+ { 1 , 1 , 1 , 1 , 0 },
387
+ { 1 , 0 , 0 , 0 , 1 },
388
+ { 1 , 1 , 1 , 1 , 0 },
389
+ { 1 , 0 , 0 , 0 , 0 },
390
+ { 1 , 0 , 0 , 0 , 0 },
391
+ },
392
+ dumpGrid {
393
+ { 1 , 1 , 1 , 1 , 0 },
394
+ { 1 , 0 , 0 , 0 , 1 },
395
+ { 1 , 1 , 1 , 1 , 0 },
396
+ { 1 , 0 , 0 , 0 , 0 },
397
+ { 1 , 0 , 0 , 0 , 0 },
398
+ },
399
+ dumpGrid {
400
+ { 1 , 1 , 1 , 1 , 1 },
401
+ { 1 , 0 , 0 , 0 , 1 },
402
+ { 1 , 1 , 1 , 1 , 1 },
403
+ { 1 , 0 , 0 , 0 , 0 },
404
+ { 1 , 0 , 0 , 0 , 0 },
405
+ },
406
+ dumpGrid {
407
+ { 1 , 1 , 1 , 0 , 0 },
408
+ { 1 , 0 , 0 , 1 , 0 },
409
+ { 1 , 1 , 1 , 0 , 0 },
410
+ { 1 , 0 , 0 , 0 , 0 },
411
+ { 1 , 0 , 0 , 0 , 0 },
412
+ },
413
+ dumpGrid {
414
+ { 0 , 1 , 1 , 1 , 0 },
415
+ { 0 , 1 , 0 , 0 , 1 },
416
+ { 0 , 1 , 1 , 1 , 0 },
417
+ { 0 , 1 , 0 , 0 , 0 },
418
+ { 0 , 1 , 0 , 0 , 0 },
419
+ },
420
+ dumpGrid {
421
+ { 1 , 1 , 1 , 1 , 0 },
422
+ { 1 , 0 , 0 , 1 , 0 },
423
+ { 1 , 1 , 1 , 1 , 0 },
424
+ { 1 , 0 , 0 , 0 , 0 },
425
+ { 1 , 0 , 0 , 0 , 0 },
426
+ },
427
+ dumpGrid {
428
+ { 0 , 1 , 1 , 1 , 1 },
429
+ { 0 , 1 , 0 , 0 , 1 },
430
+ { 0 , 1 , 1 , 1 , 1 },
431
+ { 0 , 1 , 0 , 0 , 0 },
432
+ { 0 , 1 , 0 , 0 , 0 },
433
+ },
434
+ dumpGrid {
435
+ { 1 , 1 , 1 , 0 , 0 },
436
+ { 1 , 0 , 1 , 0 , 0 },
437
+ { 1 , 1 , 1 , 0 , 0 },
438
+ { 1 , 0 , 0 , 0 , 0 },
439
+ { 1 , 0 , 0 , 0 , 0 },
440
+ },
441
+ dumpGrid {
442
+ { 0 , 1 , 1 , 1 , 0 },
443
+ { 0 , 1 , 0 , 1 , 0 },
444
+ { 0 , 1 , 1 , 1 , 0 },
445
+ { 0 , 1 , 0 , 0 , 0 },
446
+ { 0 , 1 , 0 , 0 , 0 },
447
+ },
448
+ dumpGrid {
449
+ { 0 , 0 , 1 , 1 , 1 },
450
+ { 0 , 0 , 1 , 0 , 1 },
451
+ { 0 , 0 , 1 , 1 , 1 },
452
+ { 0 , 0 , 1 , 0 , 0 },
453
+ { 0 , 0 , 1 , 0 , 0 },
454
+ },
455
+ dumpGrid { -- V
456
+ { 1 , 0 , 0 , 0 , 1 },
457
+ { 1 , 0 , 0 , 0 , 1 },
458
+ { 1 , 0 , 0 , 0 , 1 },
459
+ { 0 , 1 , 0 , 1 , 0 },
460
+ { 0 , 0 , 1 , 0 , 0 },
461
+ },
462
+ dumpGrid { -- V
463
+ { 1 , 0 , 0 , 0 , 1 },
464
+ { 1 , 0 , 0 , 0 , 1 },
465
+ { 0 , 1 , 0 , 1 , 0 },
466
+ { 0 , 1 , 0 , 1 , 0 },
467
+ { 0 , 0 , 1 , 0 , 0 },
468
+ },
469
+ },
382
470
}
383
471
local function selectDate (option )
384
472
if option == ' prev' then
@@ -679,6 +767,53 @@ function scene.keyDown(k, rep)
679
767
end
680
768
elseif k == ' h' then
681
769
triggerHint ()
770
+ elseif k == ' c' then
771
+ local output = " "
772
+ for i = 1 , 5 do
773
+ output = output .. table.concat (DATA .tickMat [i ]) .. " \n "
774
+ end
775
+ love .system .setClipboardText (output )
776
+ SFX .play (' copy' )
777
+ if TASK .lock (' copy' ) then
778
+ MSG .new (' check' , " Wow you can even copy" , 4.2 )
779
+ end
780
+ elseif k == ' v' then
781
+ local input = love .system .getClipboardText ()
782
+ if input and type (input ) == ' string' then
783
+ input = input :gsub (' %s' , ' ' )
784
+ if input :find (' %D' ) then
785
+ MSG .new (' warn' , " Can only paste numbers" , 4.2 )
786
+ SFX .play (' error' )
787
+ else
788
+ local lastEdit = 0
789
+ local pos = 1
790
+ for c in input :gmatch (" %d" ) do
791
+ if pos > 25 then
792
+ lastEdit = 26
793
+ break
794
+ end
795
+ c = tonumber (c )
796
+ if c <= 2 then
797
+ DATA .tickMat [math.ceil (pos / 5 )][(pos - 1 ) % 5 + 1 ] = c
798
+ lastEdit = pos
799
+ else
800
+ if TASK .lock (' count2+' ) then MSG .new (' warn' , " Cannot count over 2" , 4.2 ) end
801
+ break
802
+ end
803
+ pos = pos + 1
804
+ end
805
+ if lastEdit == 25 then
806
+ SFX .play (' paste' )
807
+ else
808
+ if lastEdit > 25 then
809
+ if TASK .lock (' stackoverflow' ) then MSG .new (' warn' , " Stack Overflow" , 4.2 ) end
810
+ else
811
+ if TASK .lock (' stackunderflow' ) then MSG .new (' warn' , " Stack Underflow" , 4.2 ) end
812
+ end
813
+ SFX .play (' error' )
814
+ end
815
+ end
816
+ end
682
817
end
683
818
return true
684
819
end
@@ -714,6 +849,8 @@ function scene.mouseDown(x, y, k)
714
849
selectDate (' now' )
715
850
elseif TABLE .find (gridConst .R , pattern ) then
716
851
selectDate (' random' )
852
+ elseif TABLE .find (gridConst .paste , pattern ) then
853
+ scene .keyDown (' v' )
717
854
elseif pattern == gridConst .up then
718
855
local y0 = board .Y
719
856
TWEEN .new (function (t )
@@ -841,7 +978,7 @@ function scene.update(dt)
841
978
end
842
979
end
843
980
844
- local tick = GC .load { w = 62 , h = 62 ,
981
+ local tick = GC .load { w = 62 , h = 62 ,
845
982
{ ' move' , 4 , 4 },
846
983
{ ' setLW' , 10 },
847
984
{ ' setCL' , 0 , 0 , 0 },
@@ -850,7 +987,7 @@ local tick = GC.load { w=62, h=62,
850
987
{ ' setCL' , COLOR .L },
851
988
{ ' line' , 2 , 28 , 26 , 48 , 50 , 3 },
852
989
}
853
- local cross = GC .load { w = 62 , h = 62 ,
990
+ local cross = GC .load { w = 62 , h = 62 ,
854
991
{ ' move' , 4 , 4 },
855
992
{ ' setLW' , 8 },
856
993
{ ' setCL' , 0 , 0 , 0 },
0 commit comments