COMP371-Crystal-Lang-Pres
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.
- Open your terminal to the place you want to create your crystal file
- With the editor of your choice (I will use vim in this example), type:
vim HelloWorld.cr
- This will open the editor and show you an entirely empty file.
- The syntax that will print something in termanial is:
puts "Hello, world!"
- Exit your editor and type:
crytal HelloWorld.cr
- 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 2 years ago
- September 13, 2022
License
Links
Synced at
Fri, 09 May 2025 08:40:54 GMT
Languages