Repository navigation
hulqBASH
We are hosting an independent service (on a separate EC2 instance) to compile, execute, and evaluate source code.
Languages Currently Supported: Java(8)[.java], C[.c], C++[.cpp], C#[.cs]
An S3 bucket in Amazon uses a key instead of a filename to reference a specific file.
Code snippet solution should be named with the key = solution_TEMPLATE_ID in the database.
Use the following schema to define command line arguments (note: individual command line arguments cannot contain white space, single quotes, double quotes, or back-ticks). The comment block should be in the solution file for the particular snippet.
Also, for the purposes of grading, only the OUTPUT of a file will be compared to the output of the solution for grading. Thus, the solution file MUST include a system.out.println(), << cout, printf(), etc. And the prompt should indicate that the submitted file must include the same for grading purposes.
/*
@ArgSet(1)
argument1 % Comment about argument1
argument2 % Comment about argument2
argument3 % Comment about argument3
argument4 % Comment about argument4
@ArgSet(2)
argument1 % Comment about argument1
argument2 % Comment about argument2
@ArgSet(3)
argument1 % Comment about argument1
argument2 % Comment about argument2
argument3 % Comment about argument3
*/
Each @ArgSet(X) defines a test case. For example, if we want to test a Palindrome class, we would use
java Palindrome argument1 argument2 argument3 argument4
for ArgSet(1),
java Palindrome argument1 argument2
for ArgSet(2), and
java Palindrome argument1 argument2 argument3
for ArgSet(3).
public class Palindrome
{
public static boolean isPalindrome(String s)
{
if(s.length()==0)
return false;
else if(s.length()==1)
return true;
else if(s.length()==2)
{
if(s.charAt(0)==s.charAt(1))
return true;
else
return false;
}
else if(s.charAt(0)==s.charAt(s.length()-1))
return palindrome(s.substring(1,s.length()-1));
else
return false;
}
public static void main(String[] args)
{
System.out.println(isPalindrome(args[0]));
}
}
/*
@ArgSet(1)
racecar % true
@ArgSet(2)
thisisnotapalindrome % false
bob % this second argument is ignored
@ArgSet(3)
anna % true
@ArgSet(4)
raceCar % false (capitalization)
*/
> java Palindrome racecar
true
> java Palindrome thisisnotapalindrome bob
false
> java Palindrome anna
true
> java Palindrome raceCar
false