-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathold_school_texting.pas
More file actions
74 lines (69 loc) · 7.85 KB
/
old_school_texting.pas
File metadata and controls
74 lines (69 loc) · 7.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
{
6 kyu
Texting with an old-school mobile phone
https://www.codewars.com/kata/5ca24526b534ce0018a137b5
}
program old_school_texting;
{$mode objfpc}{$H+}
uses
old_school_texting_unit;
procedure DoTest(Expected: string; msg: string);
var
Actual: string;
begin
Actual := SendMessage(msg);
writeln('Message : "', msg, '"');
writeln('Expected: "', Expected, '"');
writeln('Actual : "', Actual, '"');
if Expected = Actual then
writeln('-> OK', LineEnding)
else
writeln('-> FAIL', LineEnding);
end;
begin
DoTest('4433999', 'hey');
DoTest('666 6633089666084477733 33', 'one two three');
DoTest('#44#33555 5556660#9#66677755531111', 'Hello World!');
DoTest('#3#33 3330#222#666 6601-1111', 'Def Con 1!');
DoTest('#2**#9999', 'A-z');
DoTest('1-9-8-4-', '1984');
DoTest('#22#444 4084426655777703336667770222443322255444664066688 806999055282',
'Big thanks for checking out my kata');
DoTest('', '');
DoTest('666 6633', 'one');
DoTest('44 444 44 444 44 444', 'hihihi');
DoTest('0 0 0 0 0', ' ');
DoTest('5-5-5-**5-5-5-**1-2-3-4-', '555-555-1234');
DoTest('#44#2#44#2#44#2', 'HaHaHa');
DoTest('#3****#22*-22**4-*-2*-222', 'D=b*b-4*a*c');
DoTest('2 2-#3 3-', 'a2D3');
DoTest('#2** **#22**** ****#222', 'A--b==C');
DoTest('1 11 111 11110* ** *** **** *-#-', '.,?! ''-+=*#');
DoTest('#44#666902226668855530266999666 663308999733094448440844 44477770844 444664111 1111', 'How could anyone type with this thing?!');
DoTest('#9#33*77733022 2 222550866603 33 333222666 6604-110733666755533',
'We''re back to defcon 4, people');
DoTest('6 666 6110#444*#555 55502233044666 63302299909-110#4440#7 777666 64447777331111 1111 1111', 'mom, I''ll be home by 9, I promise!!!');
DoTest('222666885553099966688075553327777330228899907777666 63306444555 550666 66099966688777092999044666 633111', 'could you please buy some milk on your way home?');
DoTest('#444*#888330466680207777 7332224442555064447777 7777444666 660333666777099966688110#5#263377770#22#666 663', 'I''ve got a special mission for you, James Bond');
DoTest('#555#44455331107777442777330266303666 66*8033366677743380866607777882277772227774442233086660#7#339#3#44433#7#44433', 'Like, share and don''t forget to subscribe to PewDiePie');
DoTest('#222#7773328444888444899904447777044466833555 555444 433662223304428884446640333886610**0#2#555223377780#33#44466777783344466', 'Creativity is intelligence having fun. - Albert Einstein');
DoTest('#444#8*7777066 6668094433844337770999666880433805566 6662225533 3036669661104448*77770944338443377709996668804338088710**0#888#44466222330#555#666 622 27773444', 'It''s not whether you get knocked down, it''s whether you get up. - Vince Lombardi');
DoTest('#8#443307337777 77774446444777780777733 33777703444333 3334442228855589990444660338883377799906667 76667778 8866444899910#8#44330666784446444777780777733 33777706667 76667778 886644489990444660338883377799903444333 33344422288555899910**0#9#4446677778666 660#222#448877722244 444555 555', 'The pessimist sees difficulty in every opportunity. The optimist sees opportunity in every difficulty. - Winston Churchill');
DoTest('#444#333099966688027773309666777554446640666 6607777666 633844 4446640844280999666880777332555 5559990222 27773302 2266688 81109996668803666 66*80442888330866602233078877774433 310#8#443308884447777444666 660788555 555777709996668810**0#7777#833888330#5#666227777', 'If you are working on something that you really care about, you don''t have to be pushed. The vision pulls you. - Steve Jobs');
DoTest('#7#3366675553309446660277733022277729999 99903366 666884 44086660844 44466550844339990222 2660222442664330844330966677755531102777330844330666 6633777709446660366610**0#777#666220#7777#44455582663366', 'People who are crazy enough to think they can change the world, are the ones who do. - Rob Siltanen');
DoTest('#55#66 666944466404447777066 666803366 666884 44110933068877778027 755599910#9#444777744 44466404447777066 666803366 666884 441109330688777780366610**0#5#66644266 660#9#666555333426640#888#666 660#4#6663384433', 'Knowing is not enough, we must apply. Wishing is not enough, we must do. - Johann Wolfgang Von Goethe');
DoTest('#9#330433663377728330333 332777 77770944 44455533093307777444810#9#33066688833777222666 633084433602299902 2228444666 6610**0#3#77710#44#33667779990#555#4446655', 'We generate fears while we sit. We overcome them by action. - Dr. Henry Link');
DoTest('#8#44330666 66555999055544464448086660666887770777332555444999928444666 66066633308666 6 666777 777666909444555 55502233066688777036668822877770666333086663299910**0#333#77726655 555444660#310777#666 666777733888335558', 'The only limit to our realization of tomorrow will be our doubts of today. - Franklin D. Roosevelt');
DoTest('#9#442809996668805552 22255044466082555336680222 266022330623 3308870944484403 33777744477733110448877778555330266304 44488844466401-1-0-07337772223366802555 5550844330844463310**0#3#666 660#9999#4446 633777', 'What you lack in talent can be made up with desire, hustle and giving 110 percent all the time. - Don Zimmer');
DoTest('#999#666880277733066338883377708666 6660666555308666077773380266 666844337770466625550666777086660377733260206633903777332610**0#2221777710555#3394447777', 'You are never too old to set another goal or to dream a new dream. - C.S. Lewis');
DoTest('#9#4428*777708443302233777780844 44466402 2266688 80#7777#9444899993377755526631110#4440#3666 66*805566 66691102288 80844330333555240444777702022444 4075558877771', 'What''s the best thing about Switzerland? I don''t know, but the flag is a big plus.');
DoTest('#9#4499903666 66*80777722244433668444777787777087778877778028666 677771110#22#33222 2887777330844339990625533088703388833777999844 4446641', 'Why don''t scientists trust atoms? Because they make up everything.');
DoTest('#20#62660833555 5557777044 44477770366622286667770**0#3#666222110443355570633110#444*#6023 3444222833 3086660#8#94448 83377711110#8#44330366622286667770**0#7777#666777 777999110#4440#3666 66*80333666555 5556669099966688', 'A man tells his doctor - Doc, help me, I''m addicted to Twitter! The doctor - Sorry, I don''t follow you');
DoTest('#9#4499903666 66*80#222#2555222885558877770625666777 7777084477766690446668877773307277784443377771110#22#33222 288777733099966688077774466688555306633888337770377744466550266303 33777444888331', 'Why don''t Calculus majors throw house parties? Because you should never drink and derive.');
DoTest('#9#4428034443084433055533 333803399933077772999086660844330777444 4 448033999331110#22#338933 33660999666880266306331107777666 633844 44466407777633555 55577771', 'What did the left eye say to the right eye? Between you and me, something smells.');
DoTest('#9#4428034443084433077774427775507777299909443366044330283308443302225556669663334447777441110#8#44 4447777082777783377770205554448 85553303338866 669991', 'What did the shark say when he ate the clownfish? This tastes a little funny.');
DoTest('#9#44280444777702660277778777666 66288 8*77770333288866677744483307277780666 66020222666 6788 8337771110#8#443307777 72 22233022 27771', 'What is an astronaut''s favorite part on a computer? The space bar.');
DoTest('#44#6669062669990844463377770222 26609996668807777882287772 222801-0-0333777666 601-0-0-1110#666#662223310#8#44330663399808444633099966688096668855530223307777882287772 222844466401-0-0333777666 609-0-1', 'How many times can you subtract 10 from 100? Once. The next time you would be subtracting 10 from 90.');
DoTest('#9#4428036660999666880222 2555 55502087772444660222 2777 7779994446640228822 225553348861110#20#22244339**22244339087772444661', 'What do you call a train carrying bubblegum? A chew-chew train.');
DoTest('#66#338883377708777887777806284408332 2224433777 7777094466608877773304777274407273377710#8#4433999*7773302555929997777075556668 844466407777666 633844 4446641', 'Never trust math teachers who use graph paper. They''re always plotting something.');
end.