BFK_AUTO - Automatic Brainf##k Code Generator (Shortening AI)
In this problem, you'll make an automatic Brainf**k code generator. Given a text file (input data), your program should output brainf**k code that if executed it will print the text file (exactly same with given input data). The text file containts printable ASCII character only: { '<line feed>'(ASCII(10)) , '<space>'(ASCII(32)) , ... , '~'(ASCII(126)) }. It's guaranteed that the filesize of text file is less than 1MB.
Input
Text file containing printable ASCII only with size<1MB.
Output
Brainf**k code that print that text file.
Score
Your score is: Sum of all BF code length in all test data
Example
Input:
Hello World! Output:
++++++++++[>+++++++>++++++++++>+++>+<<<<-]
>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.Your Score (BF Code Length, valid command only):
111
Note: This is the first time I make my own judge, I've tested it hundred times with various test data, and so far no bug is found (found some but has been fixed). If you found a bug, you can send me info via PM or email, I'll fix that as soon as possible. Btw, here is the judge for this problem, maybe it'll be useful information for you. Good Luck and Have Fun :-D
hide comments
meettaraviya:
2018-05-16 12:04:03
All testcases are passing except for two :(. My BF code is very efficient and takes much less number of cells than the bruteforce, even then the judge says I am using too many cells. Surprisingle bruteforce passes all test cases! I don't know what is wrong. Please help @Tjandra Satria Gunawan |
|
(Tjandra Satria Gunawan)(曾毅昆):
2016-04-28 08:50:41
@linkret: BFF compiler in SPOJ use 32-bit unsigned for a cell, so because I made this problem for SPOJ, i should implement it in similar way. So changing it now will be too late because rejudging many solution with run under 22s time limit will be too difficult for SPOJ server, and not rejudging it seems unfair. So I leave this problem as it is. |
|
linkret:
2016-04-11 22:27:25
In Brainfuck, aren't the cells supposed to be 8-bit? Why would you implement them as unsigned 32-bit ints?
|
|
VilimL:
2016-04-11 22:18:15
Why does the judge use unsigned int cells, while officially BF is supposed to use bytes? Last edit: 2016-04-11 22:50:52 |
|
filipcve:
2016-04-07 20:49:06
When I test my code using ideone.com and a brainfuck interpreter it always gives me the expected answer, but SPOJ says my answer is wrong. Perhaps I misunderstood the format or something?
|
|
Mitch Schwartz:
2016-04-02 02:50:47
Judge code is here now: http://discuss.spoj.com/t/how-to-add-problem-into-spoj/693/34
|
|
testuser_124:
2016-04-01 23:30:52
Judge says "Output of your BF code is not match with the test data: it should print '0'(ASCII(48)) but your BF code is printing '0'(ASCII(858993456))". How on earth can there be 858993456 characters in ASCII, and why is 858993456th the same as 48th?
|
|
andrew hughes:
2015-04-05 03:57:24
Writing it in brainf**k itself threw a runtime error, do the inputs work with BF? |
|
Flago:
2014-02-05 10:34:22
Great problem !
|
|
(Tjandra Satria Gunawan)(曾毅昆):
2013-06-04 23:29:50
Experiment with MasterJudge done! now you can see more detailed result from MasterJudge: e.g. user's running time, user's memory usage, etc.
|
Added by: | Tjandra Satria Gunawan |
Date: | 2013-05-25 |
Time limit: | 22s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |
Resource: | This problem is purely came from my own idea \(^_^)/ |