Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- awk 'BEGIN{print "#include <stdio.h>\n#include <time.h>\n#include <stdlib.h>\nint main(){"}{print} END{print "}"}{print}' pascal.pas>output2.txt
- awk '
- {gsub(/writeln/,"printf");
- gsub(/var/,"int");
- gsub(/: integer/," ");
- gsub(/: randomize/,"srand(time(NULL))");
- gsub(/:=random/,"=rand");
- gsub(/\047/,"\"");
- gsub(/then/,"");
- gsub(/end;/,"");
- gsub(/do/,"\");
- gsub(/:=/,"=");
- gsub(/begin/," ");print}'
- awk '/./' output3.c>final.c
- pascal.pas>output2.txt
- awk 'BEGIN{print "}"}{print}' pascal.pas>output2.txt
- awk ' {gsub(/writeln/,"printf");gsub(/:=/,"=");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
- awk 'BEGIN{print "#include <stdio.h>\n#include <time.h>\n#include <stdlib.h>\nint main(){"}{print} END{print "}"}' output2.txt>output3.c
- awk '/./' output3.c>final.c
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement