Advertisement
tei123

Untitled

Jan 9th, 2019
362
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1. awk ' {gsub(/writeln/,"printf");gsub(/(\047\047)/,"\"\\n\"");gsub(/to/,"to %d ");gsub(/:=/,"=");gsub(/end;/,"");gsub(/end./,"");gsub(/do /,"{");gsub(/then/,"");gsub(/\047/,"\"");gsub(/random\(20\)/,"rand()%20");gsub(/var/,"int");gsub(/randomize/,"srand(time(NULL))");gsub(/: integer/,"");gsub(/begin/,"");print}' pascal.pas>output2.txt
  2.  
  3. awk 'BEGIN{print "#include <stdio.h>\n#include <time.h>\n#include <stdlib.h>\nint main(){"}{print} END{print "};};"}' output2.txt>output3.c
  4.  
  5. awk '/./' output3.c>final.c
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement