albertolg101's blog

By albertolg101, history, 4 years ago, In English

Sometimes, when we are training we do not have the possibility to send our answer to an OJ (we do not have internet or the link to send this exercise) but we have the test cases of these problems, for example I have the CIIC, CEOI, USACO and IOI statements and test case. The thing is, is there an application for macOS such that having the test cases already generated and the code of the exercise will evaluate your solution on your own machine?

  • Vote: I like it
  • +13
  • Vote: I do not like it

| Write comment?
»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Shell script?

  • »
    »
    4 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    It would be a great idea but I don't know how to code it :/ in fact that would be better than a desktop application

    • »
      »
      »
      4 years ago, # ^ |
        Vote: I like it +8 Vote: I do not like it

      Most basic version is something like this (I'm not sure it's 100% the same on macOS, but it should Linux with zsh and IIRC macOS is also on zsh).

      for i in `seq 1 100`; do
          ./sol < input${i}.txt > out.txt
          diff out.txt output${i}.txt
      done
      

      (Assuming you have 100 input-output files with names like input33.txt and output33.txt)

      • »
        »
        »
        »
        4 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Adding to this, instead of having to rename your files to inputXX.txt format, there should also be a way to iterate over all files in a directory, in zsh. So you can google that.

      • »
        »
        »
        »
        4 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Can you give me some documentation or link where I can learn that language and how to develop a script. It's something I've never done

»
4 years ago, # |
  Vote: I like it +5 Vote: I do not like it

I remember using ineffable in the past on Ubuntu, I guess it should also work in MacOS.

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

I work on mac, and I think that xalanq's cf-tool works pretty well. You can check it out on his blog here: https://mirror.codeforces.com/blog/entry/66552