This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| print("Generating array...") | |
| array = np.random.choice(np.arrange(0,1000000), replace = False, size = (10, 10)) | |
| print(array) | |
| print("Hope it is unique enough!") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import "fmt" | |
| func main() { | |
| fmt.Println("Welcome.") | |
| var apples int | |
| fmt.Println("Please enter a number.") | |
| fmt.Scan(&apples) | |
| if apples <= 10 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Average for statement | |
| myArray = ["yes", "no", "maybe"] | |
| for m in myArray: | |
| print(m, len(myArray), myArray) | |
| # Range | |
| for i in range(251): | |
| print(i) | |
| print("I am not responsible for your device burning somehow") | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int anInteger = 251; | |
| float aFloat = 2.51045; | |
| string aString = "Yo mama"; | |
| char aCharacter = "b"; | |
| bool aBoolean = true; | |
| Console.WriteLine($"Integer: {anInteger}"); | |
| Console.WriteLine($"Float: {aFloat}"); | |
| Console.WriteLine($"String: {aString}"); | |
| Console.WriteLine($"Character: {aCharacter}"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; New line generated | |
| (println "Hello World!") | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; Example in docs | |
| (defn greet [name] | |
| (str "Hello, " name)) | |
| ;; My first ever function (very neat) | |
| (defn selfgrade [grade] | |
| (str "Your own grade: " grade)) | |
| ;; Calling your function | |
| (selfgrade "10") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'dart:io'; | |
| void main() { | |
| print("First number: "); | |
| firstNumber = stdin.readLineSync(); | |
| print("Reading..."); | |
| sleep(Duration(seconds: 1)); | |
| print("Done!"); | |
| print("Second number: "); | |
| secondNumber = stdin.readLineSync(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; A function that will tell you nice things for some reason | |
| (defn nice [nice_word] | |
| (str "You are " nice_word)) | |
| (nice "intelligent") | |
| ;; A function that will tell you your country | |
| (defn country [country] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for i in range(1000000): | |
| print(i) | |
| # Man if your toaster survives good job | |
| nn = 69 | |
| # For your sanity nn is nerdNumber | |
| if nn > 0: | |
| print("It's equal than 0.") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; A function that will just sum and print some line. | |
| (defn sum-print [message] | |
| (str message (+ 6 12))) | |
| (sum-print "I love Lisp and its Dialects") | |
| ;; A function that will print a normal text and a reverse version | |