Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

R programming language #1001

Open
melongist opened this issue Mar 25, 2024 · 4 comments
Open

R programming language #1001

melongist opened this issue Mar 25, 2024 · 4 comments

Comments

@melongist
Copy link

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
Copy link
Owner

zhblue commented Mar 25, 2024

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

@zhblue
Copy link
Owner

zhblue commented Mar 25, 2024

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
Copy link
Owner

zhblue commented Mar 25, 2024

  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
  1. run docker.sh / podman.sh depends on your container choice

@melongist
Copy link
Author

Thank you~ :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants