[S] Worked on nim.

This commit is contained in:
eline
2023-11-29 00:22:39 +01:00
parent 8e703198b8
commit e774316a70
10 changed files with 1089 additions and 2 deletions

View File

@@ -0,0 +1,31 @@
# _____ ___ ____ ____ _____ ____ ____ _____ _____
# |_ _/ _ \| _ \ / ___|| ____/ ___| _ \| ____|_ _|
# | || | | | |_) | \___ \| _|| | | |_) | _| | |
# | || |_| | __/ ___) | |__| |___| _ <| |___ | |
# |_| \___/|_| |____/|_____\____|_| \_\_____| |_|
import std/random
type
HANDLE* = int
HWND* = HANDLE
UINT* = int32
LPCSTR* = cstring
proc MessageBox*(hWnd: HWND, lpText: LPCSTR, lpCaption: LPCSTR, uType: UINT): int32
{.discardable, stdcall, dynlib: "user32", importc: "MessageBoxA".}
# example implementation: MessageBox(0, "Hello, world !", "Nim is Powerful", 0)
var
titlemessages = @["Are you really free?",
"Window on the street, only mesmerized and pondering... Am I in the right?"]
captionmessages = @["From the river to the sea, Palestine will be free.",
"I believe and have faith in you."]
randomize() # seeds randomizer
var
randomtitle:string = sample(titlemessages)
randommessage:string = sample(captionmessages)