fork download
  1. #include "pch.h"
  2. #include <cstdio>
  3. #include <cstdlib>
  4. #include <cstring>
  5. #include <memory>
  6. #include <iostream>
  7. #include "Random1.h"
  8.  
  9. struct cell {
  10. int c, d;
  11. // int label;
  12. };
  13.  
  14. size_t width(const char* s)
  15. {
  16. const char* p;
  17.  
  18. for (p = s; *p && *p == *s; p++);
  19.  
  20. return p - s;
  21. }
  22.  
  23. size_t nop_width(const char* s)
  24. {
  25. const char *p;
  26.  
  27. for (p = s; *p; p++) {
  28. if (*p == '>' || *p == '<' || *p == '+' || *p == '-')
  29. break;
  30. if (*p == '.' || *p == ',' || *p == '[' || *p == ']')
  31. break;
  32. }
  33.  
  34. return p - s;
  35. }
  36.  
  37. cell* find_square_bracket_right(cell* p)
  38. {
  39. int depth = 0;
  40.  
  41. for (; p->c; p++) {
  42. if (p->c == '[')
  43. depth++;
  44. else if (p->c == ']') {
  45. if (depth == 0)
  46. break;
  47. else
  48. depth--;
  49. }
  50. }
  51.  
  52. return p;
  53. }
  54.  
  55. cell* init_square_brackets(cell* b)
  56. {
  57. cell* p;
  58. cell* q;
  59.  
  60. for (p = b; p->c; p++) {
  61. if (p->c == '[') {
  62. q = find_square_bracket_right(p + 1);
  63. p->d = static_cast<int>(q - p + 1);
  64. q->d = static_cast<int>(-(q - p) + 1);
  65. }
  66. }
  67.  
  68. return b;
  69. }
  70.  
  71. cell* scan(const char* s)
  72. {
  73. cell* cells = static_cast<cell*>(std::malloc((sizeof(cell)) * (strlen(s) + 1)));
  74. cell* p;
  75.  
  76. for (p = cells; *s; s += p->d, p++) {
  77. switch (p->c = *s) {
  78. case '>': case '<': case '+': case '-':
  79. p->d = static_cast<int>(width(s));
  80. break;
  81. case '.': case ',': case '[': case ']':
  82. p->d = 1;
  83. break;
  84. default:
  85. p->d = static_cast<int>(nop_width(s));
  86. break;
  87. }
  88. }
  89. p->c = '\0';
  90. p->d = 0;
  91.  
  92. return init_square_brackets(cells);
  93. }
  94.  
  95. // putcharをバッファに溜めておいて一度に出力するバージョン
  96. cell* f(cell* __restrict ip0, char* __restrict dp)
  97. {
  98. cell* __restrict ip = ip0;
  99. static char buf[100000] = {0};
  100. char* __restrict bufp = buf;
  101.  
  102. while (true) {
  103. switch (ip->c) {
  104. case '>': // increment pointer(IP)
  105. dp += ip->d; ip++;
  106. break;
  107. case '<': // decrement pointer(DP)
  108. dp -= ip->d; ip++;
  109. break;
  110. case '+': // increment value pointed by pointer(IVP)
  111. *dp += ip->d; ip++;
  112. break;
  113. case '-': // decrement value pointed by pointer(DVP)
  114. *dp -= ip->d; ip++;
  115. break;
  116. case '.': // write value to output pointed by pointer(WVP)
  117. *bufp++ = *dp;
  118. // putchar(*dp);
  119. ip++;
  120. break;
  121. case ',': // read value from input and store to the point pointed by pointer(RVP)
  122. *dp = getchar(); ip++;
  123. break;
  124. case '[': // when value pointed by pointer is zero, jump after correspoiding ']'(ZJC)
  125. (*dp) ? ip++ : (ip += ip->d);
  126. break;
  127. case ']': // when value pointed by pointer is not zero, jump after correspoiding '['(NZJC)
  128. (*dp) ? (ip += ip->d) : ip++;
  129. break;
  130. case '\0': // end of program
  131. goto end;
  132. default: // skip other characters
  133. ip++;
  134. break;
  135. }
  136. }
  137. end:
  138. bufp = '\0';
  139. std::puts(buf);
  140.  
  141. return ip0;
  142. }
  143.  
  144. void g(const char* s)
  145. {
  146. static char data[30000] = {0};
  147. auto sw = std::make_shared<Stopwatch>();
  148.  
  149. sw->Start();
  150. cell* cs = scan(s);
  151. // std::cout << "Scan Completed." << std::endl;
  152. cell* ds = f(cs, data);
  153. // std::cout << "Interpret Completed." << std::endl;
  154. std::free(ds);
  155. sw->Stop();
  156.  
  157. std::cout << "Elapsed " << sw->ElapsedMillisecond() << "ms." << std::endl;
  158. }
  159.  
  160. int main() {
  161. const char *s =
  162. " A mandelbrot set fractal viewer in brainf*** written by Erik Bosman"
  163. "+++++++++++++[->++>>>+++++>++>+<<<<<<]>>>>>++++++>--->>>>>>>>>>+++++++++++++++[["
  164. ">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[->>>>>>>+<<<<<<<]<+<<<<<<<<<]>+++++[-[->>>>>>>>>+<<<<<<<<<]>>>>>>>>>]>>>>>"
  300. "+>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<[<<<<<<<<<]>>>>>>>>>[>>>>>>[-<<<<<<->>>>>>]+<"
  301. "<<<<<[->>>>>>->>[-<<<<<<<<+>>>>>>>>]<<<<<<<<[->>>>>>>>+<<<<<<<<<<<<<<<<<[<<<<<<<"
  302. "<<]>>>>[-]+>>>>>[>>>>>>>>>]>+<]]+>>>>>>>>[-<<<<<<<<->>>>>>>>]+<<<<<<<<[->>>>>>>>"
  303. "-<<[-<<<<<<+>>>>>>]<<<<<<[->>>>>>+<<<<<<<<<<<<<<<[<<<<<<<<<]>>>[-]+>>>>>>[>>>>>>"
  304. ">>>]>[-]+<]]+>[-<[>>>>>>>>>]<<<<<<<<]>>>>>>>>]<<<<<<<<<[<<<<<<<<<]>>>>[-]<<<++++"
  305. "+[-[->>>>>>>>>+<<<<<<<<<]>>>>>>>>>]>>>>>->>>>>>>>>>>>>>>>>>>>>>>>>>>-<<<<<<[<<<<"
  306. "<<<<<]]>>>]";
  307. g(s);
  308. }
  309.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:17: fatal error: pch.h: No such file or directory
 #include "pch.h"
                 ^
compilation terminated.
stdout
Standard output is empty