zhblue / hustoj

Popular Open Source Online Judge based on PHP/C++/MySQL/Linux for ACM/ICPC and NOIP training, with easy installation. 开源OJ系统
http://www.hustoj.com/?cat=2
GNU General Public License v2.0
3.35k stars 774 forks source link

R programming language #1001

Open melongist opened 8 months ago

melongist commented 8 months ago

Is your feature request related to a problem? Please describe.

In DOMjudge(https://github.com/DOMjudge/domjudge) R(Rscript) code can be compiled and judged... https://www.r-project.org/

How can I add R programming compilation to HUSTOJ? Or Is there any plan to add R language? :)

Describe the solution you'd like R code judging~

Describe alternatives you've considered

Additional context

zhblue commented 8 months ago

what a coincidence ? https://github.com/zhblue/hustoj/tree/R-Language

zhblue commented 8 months ago

I'm not familiar with R , it seems having source and input mixed together, unless using file as input. so the solution will take care of input and output as files: data.in / user.out R solution for A+B problem

a<- scan("data.in",what=integer(),quiet=TRUE)
write.table(a[1]+a[2], file = "user.out", row.names = FALSE, col.names = FALSE)
zhblue commented 8 months ago
  1. update to latest version run make.sh in core and set OJ_CLIENT_INTERNAL=0 in etc/judge.conf
  2. set $OJ_LANGMASK=4194224; in web/include/db_info.inc.php or calculated from https://pigeon-developer.github.io/hustoj-langmask/
  3. uncomment the r-base install script in install/Dockerfile
    #RUN     DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends r-base
  4. run docker.sh / podman.sh depends on your container choice
melongist commented 8 months ago

Thank you~ :)