http://cs50.github.io/libcs50-java/edu/harvard/CS50.html
make build # builds class
make jar # builds jar
make docs # builds documentation
make deb # builds deb package
$ curl -s https://packagecloud.io/install/repositories/cs50/repo/script.deb.sh | sudo bash
$ sudo apt-get install libcs50-java
$ curl -s https://packagecloud.io/install/repositories/cs50/repo/script.rpm.sh | sudo bash
$ sudo yum install libcs50-java
- Download the latest release from https://github.com/cs50/libcs50-java/releases
- Extract
libcs50-java*
- cd
libcs50-java*
make install # may require sudo
By default, we install to /usr/local/share/java
. If you'd like to change the installation location, run DESTDIR=/path/to/install make install
as desired.
// assuming cs50.jar is in $CLASSPATH
import edu.harvard.CS50;
...
char c = CS50.getChar();
double d = CS50.getDouble();
float f = CS50.getFloat();
int i = CS50.getInt();
long l = CS50.getLong();
String s = CS50.getString();
- Decide if keeping
CS50.eprintf
. - Add tests.