Calling the ALGS4 library in eclipse

Source: Internet
Author: User
Tags object object

To download eclipse First, I chose the Eclipse IDE for Java Developers64 bit version, download it and unzip it to your favorite location and double-click Eclipse.exe to start

Then start the new project, File-and new Java project, with the project name casually written, as

Right-click the src folder, Add-New Java class, here you need to note that the Name column is the class name, I wrote TESTALGS4, in order to test the "algorithm fourth version" of the test given by the author of the sample

The code is as follows:

Import Edu.princeton.cs.algs4.StdDraw;Public Class TestAlgs4 {Public Static void Main(String[]Args){Stddraw.Setscale(-1,1);Stddraw.Clear(Stddraw.BLACK);Stddraw.Setpencolor(Stddraw.White);Stddraw.Square(0,0,1);Write some text Stddraw.Setpencolor(Stddraw.White);Stddraw.Text(0,+0.95,"Hello, world! This is a test for Java program. ");Stddraw.Text(0,-0.95,"Close This window to finish the installation.");Draw the Bullseye Stddraw.Setpencolor(Stddraw.Book_blue);Stddraw.Filledcircle(0,0,0.9);Stddraw.Setpencolor(Stddraw.BLACK);Stddraw.Filledcircle(0,0,0.8);Stddraw.Setpencolor(Stddraw.Book_blue);Stddraw.Filledcircle(0,0,0.7);Stddraw.Setpencolor(Stddraw.BLACK);Stddraw.Filledcircle(0,00.6 ); //draw a picture of the textbook   Stddraw. (000.65 0.80 ); }             /span>                

Calling the ALGS4 library in eclipse

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.