This file contains 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
def player_count(game_players): | |
players = ["You", "Me"] | |
return players | |
print("Player count: ", player_count(players) | |
# This possibly doesn't work. |
This file contains 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 (non-interactable) that will calculate the area of a triangle (plus a message by you) | |
(defn triangle [message] | |
(println "Result: ") | |
(let [b 8 h 7] (/ (* b h) 2))) | |
(str message)) | |
(triangle "This is fun!") |
This file contains 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 | |
This file contains 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 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 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 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 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 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 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") | |