DescriptionThis applications is not and never had anything to do with DEFY Media, despite the identically type stylized name, and similar logo.
I created this library before I was aware of DEFY Media's existence, and I found the word "defy" as a fitting name since it contains the word "DEF" and with the addition of only one letter, changes into a word which means to resist boundaries, and this code resists the boundaries of SmileBASIC by adding commands.
From my trend of mostly making DEF blocks, I decided to compile these blocks into a library file allowing for cleaner coding.
I have still been editing the code on my own, but I haven't been uploading it since V1.4.1.
Now I have a function which I am fairly proud of and want to shove in your face.
Coleslaw Productions Hashing Algorithm 2! CPHA2$()
Yes, 2. I have made a hash algorithm in August 2014 for Petit Computer. (I don't like it anymore.)
I decided to try again, and I think this one is much better, though I still don't believe it could combat MD5.
Anyway, it takes a string and returns a hash of 256 hexadecimal digits.
It takes 15 seconds to hash a 32kb string. (Tested on New 3DS XL)
I hope you guys like it.
You can help with the development of DEFY by leaving suggestions in the comments.
DEFYLOGO Displays the DEFY splash screen on the console.
CPHA2$(String$) Returns the result of the hashed string.
GBLUR Start point X, Start point Y, End point X, End point Y, Blur Radius
PRINTAT X, Y, String$ Prints a string on the graphics screen with the given coordinates, regardless of the current cursor position.
GBEZIER Start point X, Start point Y, End point X, End point Y, Relative deviation X, Relative deviation Y, Color
GGRADIENT Mode (|b00| 0=Horozontal 1=Vertical |b01| Crude dithering 0=Off 1=On), Start point X, Start point Y, End point X, End point Y, Color 1, Color 2
HSV(Hue in degrees 0 to 359, Saturation between 0 and 1, Value between 0 and 1)
UPPER$(String to convert to uppercase)
LOWER$(String to convert to lowercase)
REVERSE$(String$) Returns the input string reversed.
XORSTR$(S1$ as String, S2$ as String) Performs an XOR operation two strings.
RNDSTR$(Length as Integer, Start character as integer, End character as integer) Retruns a randomized string of a specified range of characters.
STRTOHEX$(String$,Digits per character as integer) Returns hexadecimal digits encoding the given string.
HEXTOSTR$(Hex digits as string,Digits per character as integer) Retruns the string encoded in hexadecimal digits.
MAPRANGE(Number, A1, A2, B1, B2) Maps a number from one range to another.
ROTATEP Point X, Point Y, Origin X, Origin Y, Angle in radians OUT Output X, Output Y
CAP(Number, Minimum number, Maximum number) Only allows a number to be within a given range
ABSTIME() Returns the the time of day in total seconds.
READBIT(Integer, Bit selector) Returns the boolean value of a single specified bit in an integer.
SETBIT(Integer, Bit selector, Value) Sets the value of a single bit in an integer, leaving the other bits as-is.
BGSTR Layer, X, Y, String$ Draws a string on the BG screen.
DISTANCE(X1, Y1, X2, Y2) Calculates distance between two points.
RNDCOL() Returns a random color value.
INF() Returns Infinity.
NAN() Returns NaN.
CR$() Returns carriage return.
LF$() Returns line feed.
NUL$() Returns null.
TOPOINT(X,Y) Converts integers between ±32767 and NaN into DEFY's point type. This function is similar to RGB()
GETX(Point) Extracts X value from Point type value.
GETY(Point) Extracts Y value from Point type value.
INTERP(N as Percentage, P1 as Point, P2 as Point) Returns an interpolated point between P1 and P2 determined by N.
TOUCHP() Returns touch coordinates as Point. Returns 0 if the touch screen is not touched.
FADECOL(N as Percentage, C1 as Color, C2 as Color)
DITHER(Color) Adds RND(8) to R, G, and B for dithering.
GRAY(L as Integer) Returns RGB(L,L,L). Returns grays.
SWITCH(C as Boolean, A as Variable, B as Variable) Returns A if C is logically true. If not, returns B.
SDIV(Dividend, Divisor, Default) Returns quotient if divisor is not zero. If zero, default is returned.
GLINER X1,Y1,X2,Y2, Color, Thickness | Draws a line with defined thickness.
FACT(N as Positive Pnteger) Returns factorial of N.
WAITSEC D as Seconds
WAITMS D as Milliseconds
HSVREAD C as 32bit RGB OUT Hue from 0-360, Saturation from 0-1. Value from 0-1
PHI() Returns Phi. (1.61803399)InstructionsLoad the library file into an alternate slot and make it usable via the USE command.
(Where "?" can be 0-3 to choose a program slot.)
After that, just write the listed commands normally into your code.