COMP371-Crystal-Lang-Pres

Comp 371 - Programming languages presentation with examples that can be downloaded and ran!

COMP371-Crystal-Lang-Pres

Comp 371 - Programming languages presentation with examples that can be downloaded and ran!

Install Crystal

Go to https://crystal-lang.org/ and click install.

Then choose your platform and follow the instructions! Once you have Crystal installed, it is time to create your first file.

Creating your first file

Creating your first file is easy.

  1. Open your terminal to the place you want to create your crystal file
  2. With the editor of your choice (I will use vim in this example), type: vim HelloWorld.cr
  3. This will open the editor and show you an entirely empty file.
  4. The syntax that will print something in termanial is: puts "Hello, world!"
  5. Exit your editor and type: crytal HelloWorld.cr
  6. This will run the program and print out Hello, world! right in your terminal!

Example Files

I have prepared a few example files that you can download and run in your own terminal!

A few of the different types of files include the step by step 'Hello, world!' file. I have also included a 'HelloCrystal.cr' file which, when editing, will show you the basics and explanation of some other things.

Repository

COMP371-Crystal-Lang-Pres

Owner
Statistic
  • 0
  • 0
  • 0
  • 0
  • 0
  • over 1 year ago
  • September 13, 2022
License

Links
Synced at

Sat, 18 May 2024 15:37:06 GMT

Languages