aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Wang2020-05-30 20:28:44 +0000
committerrepl.it user2020-05-30 20:28:44 +0000
commit4b625197ee8e769b1168bb3be929cf0ea1ed46b5 (patch)
tree519aecff8d8f45af19e9a955771e3415152cc7d3
parent751020125832686c4f38c59e29b2b94393f28cd2 (diff)
Latest version
-rw-r--r--.replit2
-rw-r--r--output1
-rw-r--r--src/encode.cpp1
-rw-r--r--test7
4 files changed, 9 insertions, 2 deletions
diff --git a/.replit b/.replit
index 413ed52..a6206bd 100644
--- a/.replit
+++ b/.replit
@@ -1,2 +1,2 @@
language = "cpp"
-run = "g++ src/*.cpp -o compress -std=c++1y; echo Compilation done; ./compress soc1.txt 0"
+run = "g++ src/*.cpp -o compress -std=c++1y; echo Compilation done; ./compress cowntact.txt 0"
diff --git a/output b/output
new file mode 100644
index 0000000..c7606c9
--- /dev/null
+++ b/output
@@ -0,0 +1 @@
+0101100000101010101100100111011010001111100111110110011010101011101011110101100101101110101101011110011010111000111111110010111011011101111110111011111011110101110001101011010101111010011011111001110101010110011011110110011101110000111111000111011011101110101010110101111101011111011010110001010110110110101011100101011001110110111001110110111110111101011101101101111011101101011000111111100101110101011000101110110000111101011000011010110011110111011110110111010111100111101100101111011101001111010011110001011110100010111110100011101111111111010000010001011011111001100010000111011000000110100010011000101111101001001101100111011010101010011101010110101010101011101000001001100101001011101001011111010000001111001100111110011111001111010001001011010010000011100100111101010101001010001111011110111110010010101000111001001011111101100100011010001001100001111111000100000100110010011101011100111111101000100101011010101000010001101110100100110111010110100100010110110011110010110001110110011111111100111010111010000010011010101000101111010001110110111100100000100101000010000000110100010011000101111101001001101100111011010101010001011001011001010010000011010110010111111100001101000100111011000111100101110011100110000100101111000110010110111101011010001000101101111100010001101110111001110101100110110111101001111100101101010111010001111001100010001111001111100100011111101100101110010101101010000011000101111101000100101001011111101001010110001111000101111101001001001001010000111100011100110001111110110100111000111111001110101110001010111011111100111110101011010001001011100111010100011001010010101111111111010001101000100100110110011101101001011011010110110101101100010111111000111001011001111110101101000110010110011100011101100010010111000011101100011110101000100110110011101101000111111111111110111101110001001111000101101101110110001111101010111011000111100100110011011100010010101100111110001100010110101101010101001000011111110111101111100111011000100101110001001110010101000101010001111111110101011101000001001100110111001011111010000010101000110011111010100010001111110110010111000110101011110001001101100111000111001100010101110110001111111001111000101111010001101110101011101001010000110100100100011100101111011011011011110010111110010010000010000101111101111000011010001001010111011111100111110101001111100110010100101011111111110100011010001001001101100111011010101001110101111110110000010101110111111101000110100010010001011011111010111001011000101011100101010110111010100100111011000110001010010111101010100111110011101100010010111000100101110001110101110101111111000111001010100110110011100010110111001101110000110011010110010011000101101011010001110101111110110000010011011001110000100111100111100010111101000100101000011010110001011001101001100111011010010001100001000001110101001111101010101110101010110111100111110100000100110001101010111100010011011001110000110101000110001011111010010001100101111101011100100110110010110010000010000011000100101011010111100011011110111111110010000001100101100111000100111111111111010011101001111100010001101110101010011101111001011011111000010000001001110010100001000000111011000101111101001001101100111000110010111010101110001011000011110111110110110011110111101110101001101010100111111000100100010011011001110001011111010010101000110011111001000010101101110001111000110010110111011101001010100011001111101010001001010000011010100111110001110101111110110000011000111101111100101011110101101111110001011001001100001100110100010011011100010110011101010101100101101110101001010000010011001010100111000001000101001111100110110010010111111100011001011111111010101111100100110110011100011011011010111111000000111010111010111111101101110011110010100011110111101111100110111000101100110100111110011000101101011010010110010011101011101011111110110101010110111000111100010100110001000010100111111111100110010110111011101001010100011001111101010001001010000011010100111110001110101111110110000011010100101101010110111010101110001100001100110100010011011100010110011101010101101101111010100111111000100101110001110110001011111010011001001101011110101110001101110001111000111111000010110000110100110111000111100010111110100110111001011111010001010011111001010100011001111101010010100111011011100011010011000111101111100110001011010110100100111111110001100001000001001111001111011110111101110101001101010100111111000100100010011011001110001011111010010101000110011111001000010101101110001111000110111101001001001111010010101000110011111001000110011110101000111111111010101110100000100110101010001011110100001000110110100101101111111000101100110100110011100001110110001011110011110000001101000100110001011111010010100010011011001110110100101111101001100101110101011100010110000111101111101100101010100110111110001000011011110110100110001111000101100110100110011100010110101001010000010110011110000110100010010110011100111110010100001101001100011110100001100100011000101110101110010101111111111011100001000011001110101000110010110111010100101000011101101001000101101111100111011000111101101111100010101011001101001110101011010001001010010110111110010000001101010001100010111110100010001001011101001011001111011111100010111110100011111111111010111001000001110110001001011100010010111000100001111010010110111100001101010111100011001011011101010010100001110010011001011111010010110101001010000101110100011001111011111001010001001000110111111111101111000100001011110101111000011010001001011111001011100010001101111000011110001001110101110101011010010100101001111011110011010110011011101011001101011001101101111001100110011001100010101110010100111100110011010110011011111011001101011001101101111011010110101110011001100111101011110101101111110001000010111101011110001001110101110101011010010010001101111011111101001111100011010001001000010100111111110110000010100001110110000110110111110001010111011111110100100101111111110001100110011010101001111001101010100100011011001111111010010101001111100100111111111111101011100011011110100101110111100001101000100100010111101000101000100110110011101101001011011010110110101101100011001100001111111001011111110110101110110100100100011000100001110110000100110010011011001110010100111100001111111001011111110110101110110100100100010011011001110001100101111111011010111010000010011000111010111111011000000100011011101110011111110100101001111000000110100010010101111010110111111000111000100001011110101111011010001000110110011111110100101101001001000111111001111111010000010111101000100010111101000100001011111011110000110100010010101110111111001111101010110101010100111010110111011110110100011010001001110110001111111110111100010101110011111111111101001110010101011011101010010011010100111011000111101111111110001110001011111010010010001100101101111010110100010101110011111111110011101011101011111110000110100010010101110111111001111101010010101110110011010110011011011110110101101011100110001010101101110101001001100100101111111110000100011011110101010011111000101011100111111111111010010111101000111111001010100111111111000011110010110001101100000100011101101101001010101001000100111110101001111100011101100010111100111100000100110110011101101001101110000110011010110010011000100101010010001101001001011100011101011101011111110001110110011110010111000010111011011011110000110101011110001010111011111100111110101000110001100101100101010110100100101110001111010010100111100000110010011010111101011100010111101000111010111010111111101100111011011001010001001100101111110111101011100010010001101101001111110000001000010111101011110000111010111111011000001110110001111111110111100010101110011111111111101001011011101010010011010101011000001010011101100011110111111111000101101110010111110100101001011101001011111000110100010011001011011101010010100000010011011001110110100011101100001100010011011001011001000001000001100010010101101011110000100101111011110101000110010111010101110001011000011110111110110010100100110010111110100110101011110000100001101111000110010110111010100101000000101101010010100000101100111100001101000100101100100100111010110111011110101011100001110101111110110000001000100101110100100101010110000001011111010010000111110111111101111000110010110111010100101000000101101010010100000101100111100001101000100101100100100111010110111011110101011100001110101111110110000001000100101110100100101010111100010011101100011110111111111000101111101001010011000010110011001011001011110111110001001001100101100101001000000110101000101100100111011000100101110001001110010101000010010111100001000010001001101000001000111111011001011100010001001011101001001010110010111111011110101110001010100011010111001001100100010110111110010110000110011110100110111011110001110110001001011100010111111000010111101110111111100011100001001011110001100101101110101001010000001110011000110001001010110101111000101100111001101111001100110011111011100101011100010110100000101101100001111000111100110011001100110000101100010000011110000011110110001011010100011110110001011011000101100010110001111011000101101000011011100100110000111100000111100001010100011010111001001100011010101000001001100100111010010000100011100010001011011111001100101110101011100010110000111101111101100010111110100100110110011100001111001100111100010110111110010010100001000000101100110110001111110011000101010011011001110000111100001010100011001111101101001001101100111000011110110010010111000111010111010111111100010110001000101001110110001011110000111100010011011001110110100010110110010100101101000011111010111101000101010101000110011111001000
diff --git a/src/encode.cpp b/src/encode.cpp
index e0d5199..69aafee 100644
--- a/src/encode.cpp
+++ b/src/encode.cpp
@@ -355,6 +355,7 @@ struct file
string huffmancompress(string s)
{
vector<bool> enc = huffman::encode(s);
+ ofstream cout("output");
for (auto b : enc) cout << b;
cout << endl;
string ans;
diff --git a/test b/test
index 3f802fb..c14a342 100644
--- a/test
+++ b/test
@@ -1 +1,6 @@
- 傾燩═牾z=徢鉸杠顆;漀в閠狠n穂-嬇鈗杠n7嵠泷~縚疻陁狠铟~窟飛籡k第韛籡甒玌牾z絕雞狠顆籡k礪膈z=炏g迟靨;澪鐂筡甒玌j第眦{睫飛;漀вi碯k5嵠鉸杠n穂膈鷠具飛惠n穂k礪-査e操l6岶Q鑤篯甒玌猆陁狠n粉眦{=炏g砓膈鷠具秣鹽具飛惠顆籡甒玌j第m钝眦~?熛珞?熛珞y<濷'撋鋜管n穂-査弪~?嚸醦竆k5歁τ轸z絕k5 喢a癤雞:幥c盭雞篯膈z絕雞:幥泷鴟>熛珞y嫁飛惠铟{睫飛籡.椝錼管铟{=炏珞y糬k5 喢狃鴟具o7浲骟y<炏g迟靨惠顆;澪g3橪τi碯k5歁τi蹿眦鹽>烵'撋鋜管顆;嶨#慔┰牾z睫飛籡. 匓(擩%壞b盭, 匓═陁狠顆惠n穂璙+暿錼筡膈z=嘋⌒梏鷠具秣~?嘋⌒h蹿m钝韛籡.椝錼筡k礪-朘%捝d2屍c1屍鉸杠铟{=濷вi碯璙玌*旿ヒ轸z=伬`癤,査e瞃,朘%塂"埬b盭,嬇怦x<廏#埬b必l钝眦~縚k5嵠c盭琕陁:澪珞y糬疻牾z=廏ㄔ陁:幥c1楲τi碯璙+娕b1樚f砓,朘%捝d2屍c1屍c1楲τ閠狠顆籡.椝e操l6汳τ轸~?廏#侫犘梏z=炏g砓,婨"懭潋y<濷вi4歁&撋d2橪&撋潋y<廏Q梏~?徢泷x<炏鐂管顆;漀вi蹿眦鹽>熛g3屍c1屍泷x<濷вi蹿m6岶#懭d2 兞囵x糬疻陁:嚸狃~窟飛惠n穂璙玌*暿弪y嫁o粉m6浲f砓, @ 惾潋鵿綺疻+暿e2橪&揑ひ閠:澪珞y糬疻牾z=廏Qh碯膈z睫o穂-朘%塂ㄔ陁:嶨Q鑤:澪珞鵿具o穂-査e瞃,朘%扞$捝d操l禰k礪-婨"圖⒀h蹿眦~縚k5毻f砓,朘%塂"慔$捝鋜9淣'撋d2櫶f砓,朘%扞$扞$捝鋜管n7浲骟?嘋═*旿%扞ひ閠:漀вi4毻f砓,嬇b1 咰⌒鑤狠铟~縚雞狠顆籡膈鷠>熛鐂筡雞狠顆籡膈~縚疻j礪-嬇鈗杠n7 喢醦竆甒+暿錼9溛鐂9溛g砓, 偭`柏l6嵠c必祧{絕/椝e
+ 傾燩═猆j5歁&撋鋜管n穂-嬇怦鴟>熛珞鵿具o7浲f砓琕玌陁篯膈z絕k5歁τi蹿韛籡k礪膈z=炏g砓雞:幥泷?烵в閠狠n粉韛惠铟~窟飛惠铟鹽具秣{絕雞:幥c盭k礪璙牾z絕/椝e操祧鹽>熛鐂筡甒玌j5毻f迟祧{睫o7浲鎠管顆;嚸狃~?徢鉸杠n粉韛惠顆籡甒玌j礪膈鷠綺膈鷠具o穂k5岶ㄔj第m钝m禰璙陁:漀┰j5毻鎠管n粉韛;澪鐂管n粉眦鹽具秣{絕雞狠n粉m钝眦{睫飛惠n穂k5嵠泷?烵в閠篯甒j5岶Q鑤狠n7 喢狃x糬k5 喢a癤k5毻骟y嫁飛惠铟{睫o粉韛籡膈z=炏珞y嫁o7汳τ轸z睫飛籡.椝弪y糬/椝弪y<廏Q梏z絕/婨⒀梏鷠綺/嬇鈗杠铟縚/ 侫 圖⒀h蹿眦鹽>熛g3孎#劼醦杠n7 伬`癤,婨"懭d2孎Q梏鷠綺/桲%捝d操l6浲鎠管n穂璙玌猆*暿錼筡甒j礪璙玌猆猆陁篯. 侫 惾d2橪)擩ヒ閠篯.桲ヒ轸鷠綺/ 伬囵x<炏g3櫶骟鵿>熛珞鵿>熛珞y糬/婨"慔ひi碯-朘% 偭鄍8淣'撋潋y糬疻玌猆*旿)娕怦x嫁秣{睫秣鹽>烵'揑㏕*娕鈗8淣'揑ひ轸~窟o7汳&壞b盭,婨"懭d2 喢狃?廏#侫 惾d2橪&撋鋜筡雞:澪珞縚/婨"慔┰j礪璙玌*
+匓!埬b必靨籡.桲%捝d操靨籡k礪-朘%塂⒀h蹿m6浲骟y<濷вi4嵠鉸杠n7浲骟?熛鐂筡雞篯. 侫 惾d瞃琕玌*奅⒀梏z絕/嬇鈗杠n粉眦{=濷' 侫 怘)
+匓!繾癤,婨"懭d2孎Q梏鷠綺/桲%捝d操l6浲鎠管n穂璙玌猆*奅⒀h4歁τi4歁)擩% 偭`癤k5歁τ轸?嚸a癤,婨"懭鋜管n7嵠泷x<濷в閠:澪鐂9溛g3 咰!怘ひ轸z=徢c1楲τi蹿眦{絕k礪-婨"圖⒀h蹿眦鹽>廏#埬b必靨惠顆;澪鐂筡k5毻f迟l钝眦{絕/椝弪鵿>烵вi碯璙陁篯.嬇怦x<炏g3孎#埬怦x<炏珞鵿>烵'壞怦~窟o7汳τ閠:漀┰j礪璙+
+偭`0孎Q梏鷠綺/婨"慔)擩ヒ轸~縚/桲┰j5嵠泷x<廏Q梏鷠綺/桲%扞$扞$扞)
+吢狃x<徢鉸8溛g3屍泷~窟o穂-査錼9幥泷~?熛鐂筡雞:嶨ㄔ陁狠铟~?熛珞鵿綺疻j礪-婨"慔ひ閠:澪鐂筡甒+娕b1楲)擩┰牾縚/嬇b盭,婨"慔$捝d操l6浲鎠管n穂-朘ヒi蹿m禰k第m禰k第m6岶Q梏~?徢鉸8淣вi4毻骟~縚k礪-嬇b1楲τi4毻鎠9幥鉸杠n7岶#慔ひ閠:嚸醦杠n7嵠泷x糬疻+奅"懭d操l6浲鎠管n穂-嬇怦窟秣{睫飛;嶨#懭潋y<廏Qh蹿m钝韛惠n7嵠泷鴟綺疻陁狠n7嵠泷x<濷'撋d2櫶f迟靨;嶨#慔┰j5毻骟鵿>徢c1孎Qh碯k礪璙玌猆*旿% 劼狃窟秣{睫秣鹽>熛鐂管n7岶#慔ひ閠:嶨#懭鋜9淣㏕*奅═*娕怦縚疻陁篯. 侫 惾d2櫶f迟靨;漀в轸鷠綺/ 侫燩═*娕b1樚骟鵿綺疻+奅"埬怦~窟o7汳τ閠:幥c盭琕牾z=廏#懭d操l6浲鎠9幥鉸8溛g3孎ㄔ陁狠n7嵠泷?熛珞y<廏Q梏z絕/嬇b必靨籡甒陁篯.桲)
+吢a癤,朘%扞$壞鈗8淣в轸z睫o粉m钝m钝眦{=濷в轸鷠>烵'揑$ 侫 凚⌒梏鷠具秣{=嚸a癤,婨"慔┰陁