Jump to content

The under 100 line challenge!

fletch to 99

And another one, this one will capture magnet links and send it to a transmission daemon using it's web interface

I changed the code so stuff that is usually defined in the config file is here defined as static variables. Also, removed the part to generate a tray icon notification (too much code for the 100 lines)

 

using System;using System.IO;using System.Net;using System.Text; namespace RaspiGrabber{    static class Program    {        static string uri = "http://192.168.1.10:9091/transmission/rpc";        static string dest = "/data/downloads";        static bool useProxy = false;        static string template = "{{\"method\":\"torrent-add\",\"arguments\":{{\"paused\":false,\"download-dir\":\"{0}\",\"filename\":\"{1}\"}}}}";        static string proxy = "localhost";        static int proxyport = 8888;         static void Main(string[] args)        {            string session = GetSessionId(uri);            var hwr = HttpWebRequest.Create(uri);            hwr.Method = WebRequestMethods.Http.Post;            hwr.ContentType = "json; charset=UTF-8";            if (useProxy) hwr.Proxy = new WebProxy(proxy, proxyport);            hwr.Headers.Add("X-Transmission-Session-Id", session);            string body = String.Format(template, dest, args[0]);            Stream bodystream = hwr.GetRequestStream();            int bytes = body.WriteToStream(bodystream);            var resp = hwr.GetResponse();        }         static string GetSessionId(string uri)        {            var hwr = HttpWebRequest.Create(uri);             if (useProxy) hwr.Proxy = new WebProxy(proxy, proxyport);            WebResponse resp;            try            {                resp = hwr.GetResponse();            }            catch (WebException e)            {                if (!e.Message.Contains("409")) throw e;                else                    resp = e.Response;             }            string a = resp.Headers["X-Transmission-Session-Id"];            return a;        }                public static int WriteToStream(this string input, Stream stream, Encoding enc)        {            byte[] stringbytes = enc.GetBytes(input);            stream.Write(stringbytes, 0, stringbytes.Length);            return stringbytes.Length;         }         public static int WriteToStream(this string input, Stream stream)        {            return input.WriteToStream(stream, new UTF8Encoding());        }    }}
Link to comment
Share on other sites

Link to post
Share on other sites

private void button1_Click(object sender, EventArgs e)        {            int v;            if (textBox1.TextLength < 1 || int.TryParse(textBox1.Text, out v))                MessageBox.Show("Error");            else            MessageBox.Show(capitals(textBox1.Text));                    }        public string capitals(string input)        {            char letter;            char firstletter,a=' ';            string fulltext = "";            for (int i = 0; i < input.Length; i++)            {                if (i == 0)                {                   firstletter = input[0];                   a =  char.ToUpper(firstletter);                }                else                 {                 letter = input[i];                 fulltext += letter;                }            }           return a + fulltext;        }

Sets first letter to capital without using stringbuilder.

Link to comment
Share on other sites

Link to post
Share on other sites

-snip-

 

Sets first letter to capital without using stringbuilder.

Errm... 1) Why the extra assignment in that else block? Why not just this?

else {    fulltext += input[i];}

2) Strings in C# are immutable anyway, so repeatedly concatenating every character in the string to add it to the return value is probably a lot more inefficient than using a StringBuilder explicitly.

 

This would a much cleaner implementation, by far:

public string CapitalizeFirstChar(string input){	return Char.ToUpperInvariant(input[0]) + input.Substring(1);}

Or in the new fancy C# 6 Expression-Bodied syntax, even:

public string CapitalizeFirstChar(string input) => Char.ToUpperInvariant(input[0]) + input.Substring(1);
Link to comment
Share on other sites

Link to post
Share on other sites

  • 2 weeks later...

Hey Guys i made a simple Dice program for the command line.

 

#include <stdio.h>#include <string.h>#include <time.h>int main(int argc, char ** argv){    int faces, hasZero, output, roleAgain, numDice, ready = 0, i, total;    printf("Welcome to Dice.\n");    printf("How many Dice would you like to use? ");    scanf("%d", &numDice);    printf("Enter the number of faces you want the dice to have: ");    scanf("%d", &faces);    printf("Do you want the dice to include 0? ");    hasZero = enterYesNo();    while(ready == 0)    {            printf("ready to roll? ");        ready = enterYesNo();    }        srand(time(NULL));    roleAgain = 1;    while(roleAgain == 1)    {            total = 0;        for(i = 1; i <= numDice; i++)        {            if(hasZero == 1)            {                output = rand() % (faces -1);            }            else if (hasZero == 0)            {                output = rand() % faces + 1;            }        printf("Dice %d = %d\n",i, output);        total = total + output;        }        printf("Total = %d\n", total);        printf("Would you like to role again? ");        roleAgain = enterYesNo();    }}    int enterYesNo(){    int  nAnswer = 2, i, length;    char answer[4];        while(nAnswer == 2)    {    scanf("%s", answer);    length = strlen(answer);    for(i = 0; i < length; i++)        {            if(answer[i] > 90)            {                answer[i] = answer[i] - 32;            }        }        if(strcmp(answer, "YES") == 0)        {            nAnswer = 1;        }        else if(strcmp(answer, "NO") == 0)        {            nAnswer = 0;        }        else        {            printf("Enter Yes or No.\n");        }    }    return nAnswer;}
Link to comment
Share on other sites

Link to post
Share on other sites

 

 

 
------------{asks user for number}-------------print("type a number")      local input = tonumber(io.read())----------{split number into digits within a table}----------- local Digit = {tonumber(string.sub(input, 1, 1)), tonumber(string.sub(input, 2, 2)), tonumber(string.sub(input, 3, 3))}local length = string.len(input)--------------{convert to number}--------------     local lengthNumber = tonumber(length)-----------{writing out the number}------------if lengthNumber == 1 thenif tonumber(input) == 1 thenio.write("One\n")endif tonumber(input) == 2 thenio.write("Two\n")endif tonumber(input) == 3 thenio.write("Three\n")endif tonumber(input) == 4 thenio.write("Four\n")endif tonumber(input) == 5 thenio.write("Five\n")endif tonumber(input) == 6 thenio.write("Six\n")endif tonumber(input) == 7 thenio.write("Seven\n")endif tonumber(input) == 8 thenio.write("Eight\n")endif tonumber(input) == 9 thenio.write("Nine\n")endendif (lengthNumber == 2 and Digit[1] == 1) thenif Digit[2] == 0 thenio.write("Ten\n")endif Digit[2] == 1 thenio.write("Eleven\n")endif Digit[2] == 2 thenio.write("Twelve\n")endif Digit[2] == 3 thenio.write("Thirteen\n")endif Digit[2] == 4 thenio.write("Fourteen\n")endif Digit[2] == 5 thenio.write("Fifteen\n")endif Digit[2] == 6 thenio.write("Sixteen\n")endif Digit[2] == 7 thenio.write("Seventeen\n")endif Digit[2] == 8 thenio.write("Eighteen\n")endif Digit[2] == 9 thenio.write("Nineteen\n")endendif (lengthNumber == 2 and Digit[1] == 2) thenio.write("Twenty")if Digit[2] == 1 thenio.write("One\n")endif Digit[2] == 2 thenio.write("Two\n")endif Digit[2] == 3 thenio.write("Three\n")endif Digit[2] == 4 thenio.write("Four\n")endif Digit[2] == 5 thenio.write("Five\n")endif Digit[2] == 6 thenio.write("Six\n")endif Digit[2] == 7 thenio.write("Seven\n")endif Digit[2] == 8 thenio.write("Eight\n")endif Digit[2] == 9 thenio.write("Nine\n")endend
 

LUA

 

this is my first real world application program, however it is not finished it only accepts integers 1-29., it probably could be under 100 lines, but i like to make my code readable. had trouble with the if, else, elseif and a few other small mistakes, but my friend Austin helped me out like the good friend that he is

 

This could be done so much more effeciently my eyes... so many lines just for "if number = x then io.write("y")" you are heading the right way with the table though xD i'd say you do something like this:

 

number = {"one","two","three"}io.write(number[digit[2]])
Link to comment
Share on other sites

Link to post
Share on other sites

Here is my java program that can convert decimal to binary and vise versa in under 100 lines.

 

import java.awt.GridLayout;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import javax.swing.JFrame;import javax.swing.JTextField;import javax.swing.JLabel;public class BinaryCalculator extends JFrame {JFrame frame;JLabel label1;JLabel label2;JTextField field1;JTextField field2;int input1;int input2;int output1;int output2;public BinaryCalculator() {frame = new JFrame("Bianary Calculator");label1 = new JLabel("");label2 = new JLabel("");field1 = new JTextField("Bianary Here", 15);field2 = new JTextField("Decimal Here", 15);field1.addActionListener(new ActionListener() {public void actionPerformed(ActionEvent e) {input1 = Integer.parseInt(field1.getText());field1.setText("");}});field2.addActionListener(new ActionListener() {public void actionPerformed(ActionEvent e) {input2 = Integer.parseInt(field2.getText());field2.setText("");}});input1 = 0;input2 = 0;frame.setDefaultCloseOperation(EXIT_ON_CLOSE);frame.setSize(500, 500);frame.setLayout(new GridLayout(2, 2));frame.add(label1);frame.add(label2);frame.add(field1);frame.add(field2);frame.setLocationRelativeTo(null);frame.setVisible(true);}public static void main(String args[]) {BinaryCalculator gui = new BinaryCalculator();gui.go();}public void go() {for(int i = 0; 0 < 1; i++) {try {Thread.sleep(500);} catch(InterruptedException ex) {   Thread.currentThread().interrupt();}if(input1 != 0) calc(input1);if(input2 != 0) calcToBianary(input2);}}public void calc(int a) {output1 = 0;String input = String.valueOf(a);for (int i = 0; i < input.length(); i++) {   if (input.charAt(i) == '1') {      output1 += square((input.length() - 1) - i, 2);}}label1.setText(Integer.toString(output1));input1 = 0;}public void calcToBianary(int a) {output2 = 0;for(int i = 50; i >= 0; i--) {if(a - square(i, 2) >= 0) {output2 = output2 + square(i, 10);a = a - square(i, 2);}}label2.setText(Integer.toString(output2));input2 = 0;}public int square(int a, int b ) {if(a == 0) return 1;int total = b;for(int i = 0; i < a - 1; i++) {total = total * b;}return total;}}

http://pcpartpicker.com/p/9DNjLk I like the night theme, it complements my dark basement. If you are reading this then you must also be a fan of the night theme.

01011011 01000010 01101001 01101110 01100001 01110010 01111001 00100000 01001000 01100101 01110010 01100101 01011101 

Link to comment
Share on other sites

Link to post
Share on other sites

Here is my java program that can convert decimal to binary and vise versa in under 100 lines.

-snip-

Please put that in a code block, because that is not at all ideal for readability. Thanks.

Link to comment
Share on other sites

Link to post
Share on other sites

Here's an old Python class I wrote for reading from or writing to another processes memory I used when I made a Twitch plays Hearthstone bot. I remember searching a ton on Google for something like it (cuz I'm lazy like that and didn't want to do work) but couldn't find anything so I thought I'd post it after finding it in the old VM in case there's still nothing out there.

import ctypes as ctfrom ctypes import wintypes as wtimport os,win32process,win32api,win32ui,time,struct,sysclass MemoryReader:    PROCESS_VM_READ = 0x0010    PROCESS_VM_WRITE = 0x0020    PROCESS_VM_OPERATION = 0x0008    PAGE_READWRITE = 0x0004    WM_SYSCOMMAND = 0x0112    WM_ACTIVATE = 0x6    WM_HOTKEY = 0x0312    PROCESS_QUERY_INFORMATION = 0x0400    PROCESS_TERMINATE = 0x0001    def __init__(self, windowName, moduleName = None):        self.windowName = windowName        self.moduleName = moduleName if moduleName else windowName + '.exe'        self.hwnd = win32ui.FindWindow(None,self.windowName).GetSafeHwnd()        self.processId = win32process.GetWindowThreadProcessId(self.hwnd)[1]        self.handle = self.__getHandle()        self.baseAddress = self.__getBaseAddress()    def __getHandle(self):        handle = ct.windll.kernel32.OpenProcess(ct.c_uint(MemoryReader.PROCESS_QUERY_INFORMATION | MemoryReader.PROCESS_VM_READ | MemoryReader.PROCESS_VM_WRITE | MemoryReader.PROCESS_VM_OPERATION), ct.c_int(1), ct.c_uint(self.processId))        if handle == ct.c_void_p(0):            raise RuntimeError('Unable to get process handle.')        return handle    def __getBaseAddress(self):        class ModuleInfo(ct.Structure):            _fields_ = [('baseOfDll', wt.LPVOID),('sizeOfImage', wt.DWORD),('entryPoint', wt.LPVOID)]        bufferSize = 256        imageName = ct.create_string_buffer(bufferSize)        length = ct.windll.psapi.GetProcessImageFileNameA(self.handle, imageName, wt.DWORD(bufferSize))        if length <= 0:            raise RuntimeError('Unable to get image file name.')        modules = (ct.c_ulong * 1024)()        count = ct.c_ulong()        if ct.windll.psapi.EnumProcessModules(self.handle, modules, ct.sizeof(modules), ct.byref(count)) == 0:            raise RuntimeError('Unable to enumerate modules.')        moduleHandle = 0        moduleNameInBytes = bytes(self.moduleName,'utf-8')        for i in range(0,count.value // ct.sizeof(wt.HMODULE)):            moduleName = ct.create_string_buffer(bufferSize)            if ct.windll.psapi.GetModuleBaseNameA(self.handle, modules[0], moduleName, ct.sizeof(moduleName)) == 0:                raise RuntimeError('Unable to get module name.')            if moduleName.value == moduleNameInBytes:                moduleHandle = modules[i]                break        if moduleHandle == 0:            raise RuntimeError('Unable to get module handle.')        info = ModuleInfo()        if ct.windll.psapi.GetModuleInformation(self.handle, modules[0], ct.byref(info), ct.sizeof(info)) == 0:            raise RuntimeError('Unable to get module info.')        return info.baseOfDll    def __del__(self):        ct.windll.kernel32.CloseHandle(self.handle)    def read(self, address, bytesToRead):        bytesRead = ct.c_size_t(0)        address = ct.c_void_p(address)        btr = ct.c_size_t(bytesToRead)        buffer = ct.create_string_buffer(bytesToRead)        ct.windll.kernel32.ReadProcessMemory(self.handle, address, ct.byref(buffer), btr, ct.byref(bytesRead))        return bytearray(buffer)    def readInt(self, address):        bs = self.read(address,4)        return int.from_bytes(bs,signed=True,byteorder=sys.byteorder)    def readUInt(self, address):        bs = self.read(address,4)        return int.from_bytes(bs,signed=False,byteorder=sys.byteorder)    def readMultiLevelPointer(self, address, offsets):        if address == 0:            address = self.baseAddress        val = address        for offset in offsets:            val = self.readInt(val + offset)        return val    def readByte(self, address):        return self.read(address, 1)    def readFloat(self, address):        bs = self.read(address,4)        return struct.unpack('f', bs)[0]    def write(self, address, buffer):        oldProtect = ct.c_uint()        toWrite = ct.create_string_buffer(buffer)        address = ct.c_void_p(address)        bytesWritten = ct.c_int()        ct.windll.kernel32.VirtualProtectEx(self.handle, address, ct.sizeof(toWrite), MemoryReader.PAGE_READWRITE, ct.byref(oldProtect))        ct.windll.kernel32.WriteProcessMemory(self.handle, address, toWrite, ct.sizeof(toWrite), ct.byref(bytesWritten))        return bytesWritten.value    def writeByte(self, address, byte):        return self.write(address, bytes([bytes]))    def writeInt(self, address, i):        return self.write(address, struct.pack('i',i))    def writeUInt(self, address, i):        return self.write(address, struct.pack('I',i))    def writeFloat(self, address, f):        return self.write(address, struct.pack('f',f))
Reading from memory goes something like:

import timefrom MemoryReader import MemoryReader if __name__ == '__main__':    mr = MemoryReader('Hearthstone')     offsets = [0x00A1E264, 0x310, 0x6D0, 0x568, 0x6E4, 0xC8]     while True:        screen = mr.readMultiLevelPointer(0, offsets)        print(screen)        time.sleep(1)
which prints out what screen the game is currently on, 3 = main menu, 5 = collections, 6 = opening packs of cards etc.

1474412270.2748842

Link to comment
Share on other sites

Link to post
Share on other sites

Update On my Old Parabla Drawer-

Polynomial Drawer V3!

 

Updates-

Any Graph in factored Form

Consistent Drawing Speed

No More Difficult to understand Variables! :D

 

Heres the source-

@[member=Echo] offsetlocal EnableDelayedExpansionif defined worker set "txt=1" && title worker #%workernumber% && goto resdraw:toptitle Equation drawer! - MultiCOREclsset /p degree= Enter the total solutions: if not defined degree set "degree=1"set /p a= Numerator of A: if not defined a set "a=1"set /p b= Denominator of A: if not defined b set "b=1"set /p k= Constant: if not defined k set "k=0"set /p yoff= Y Coordinate of bottom left: if not defined yoff set "yoff=-10"set /a "yoff-=1"set /p xoff= X Coordinate of bottom left:if not defined xoff set "xoff=-40" set /p hor= Horizontal Lines :if not defined hor set "hor=78"set /p vert= Vertical Lines :if not defined vert set "vert=25"set "d=%degree%"echo.echo. >> "%cd%\Equation Output.txt" :solutionsset /p x%d%sol= Solution #%d%: if not defined x%d%sol set "x%d%sol=0"set /a "d-=1"if %d% GTR 0 goto solutionsset "d=%degree%"set "equa=(%a%":generaterset "equa=%equa%*(%%workx%%-!x%d%sol!)"set /a "d-=1"if %d% GTR 0 goto generaterset "equa=%equa%)/%b%+%k%"set "workx=%xoff%"set "drdown=%vert%"set /p threadded= Enter the total number of threads this batch file will use (Per Cycle (1s)): if not defined threadded set "threadded=2"if %threadded% LEQ 1 set "threadded=2"set "worker=Defined"set "workernumber=1":masterstart "" /min %0 set /a "drdown-=1"set /a "workernumber+=1"if %workernumber% LEQ %threadded% goto masterset "workernumber=1":keepsyncedtitle Waiting on Worker #%workernumber% - %drdown% Lines Left:isreadywaitfor /SI isready%workernumber% & clswaitfor master%workernumber% /t 1 || goto isreadyset /a "workernumber+=1"set /a "drdown-=1"if %drdown% LEQ -%threadded% set "worker=" && goto doneif %workernumber% LEQ %threadded% goto keepsyncedset "workernumber=1"goto keepsynced:resdrawif %drdown% LEQ 0 goto doneif not defined worker title %drdown% Lines Left to computeset /a "workx=%xoff%set /a "worky=%drdown%+%yoff%"set "l="set "dr=0":redrawcall set /a "t=%equa%"set /a "workx-=1"call set /a "tt=%equa%"set /a "workx+=2"call set /a "ttt=%equa%"set /a "workx-=1":drawingset "write=."if %worky% EQU 0 set "write=-"if %workx% EQU 0 set "write=/"if %worky% EQU !t! set "write=X" && goto skipif %worky% GTR !tt! if %worky% LSS !ttt! set "write=X" && goto skipif %worky% LSS !tt! if %worky% GTR !ttt! set "write=X" && goto skip:skipset "l=%l%%write%"set /a "dr+=1"set /a "workx+=1"if %dr% LSS %hor% goto redrawset /a "drdown-=%threadded%"waitfor isready%workernumber%echo %l% >> "%cd%\Equation Output.txt"clswaitfor /SI master%workernumber%if %drdown% LEQ 0 goto donegoto resdraw:donetitle Done!if defined worker exitgoto top

Heres a Video I uploaded to youtube about it!-



You can look at the description of the youtube video for a download if you don't know how to save batch files from source.
and for the .txt with various graphs I made!
 

A riddle wrapped in an enigma , shot to the moon and made in China

Link to comment
Share on other sites

Link to post
Share on other sites

I made a pong clone that has under (or about, not sure) 100 lines of code. If it requires downloading a library (SDL), does it still count?

CPU: i5-6600k @ 4.4GHz | Motherboard: Asus Z170 Pro Gaming | RAM: 8GB HyperX Fury | GPU: Asus Strix GTX 980 | Case: NZXT Noctis 450 Red/Black | Storage: 256GB Sandisk SSD + 1TB Western Digital HDD | PSU: EVGA 750w | Monitor: ASUS VS247H | CPU Cooler: Cooler Master Hyper 212 Evo | Keyboard: $15 Cheapo Rubber Dome Keyboard | Mouse: Rosewill RGM-300


Linus Tech Tips Pebble (and Pebble Time) notifier watchface!

Link to comment
Share on other sites

Link to post
Share on other sites

We have a competition called C² or sometimes CCA. The goal is to write a complete application (so not just a library etc.) in 100x100 characters. You can see the entries here and download the source at the end of the post.

The entries are:

minx: A FruitNinja clone, with Windows icons instead of fruits.

Mat: A complete Tetris game, with music and cheat codes. Screenshot.

BugFix: A minimalistic screen magnifier.

James: A complete turing machine.

Wambo: A complete game of helicopter. Playable in notepad.exe (!).

 

Compiler: Klick

Download the sources (each entry includes an english description): Klick

 

The source code will be hard to read. Here is the source from Mats tetris:

Dim $3="script.au3",$f=FileInstall("tetris.au3",$3)&FileRead($3),$l=StringRegExp($f,":(\d)",3),$s[ _22][10],$n[4][4],$m=StringRegExp($f,"~(-?\d)",3),$o=StringRegExp($f,"@(\d+)",3),$p=StringRegExp($f _,";(\d)",3),$c=StringRegExp($f,"`(\d+)",3),$t='"Score: "&$u&@LF&"Lines: "&$v&@LF&"Level: "&$w',$r[ _5]=[0,1,3,5,8],$kc=0,$ka=0,$i=@TAB&"Highscores:",$d="Mat's Tetris²",$j=GUICreate($d,420,464),$k,$1 _="GUICtrlCreateDummy()",$kk=StringRegExp($f,"%(\w)",3),$a[5][3]=[["w",Execute($1)],["a",Execute($1 _)],["s",Execute($1)],["d",Execute($1)],["b",Execute($1)]],$2=GUISetAccelerators($a);`11141120~-2~1..If $CmdLine[0] Or Run('"'&@AutoItExe&'" '&$CmdLineRaw&" m")*0 Then Exit AutoItWinSettitle(@TAB)+m(0)Func m($3);4;1;2;3;2;1;0;0;2;4;3;2;1;2;3;4;2;0;0;0;1;2;3;5;7;6;5;4;2;4;3;2;1;1;2;3;4;2:2:1:1:2:1:1:2Return $3<40 And m($3+Beep($o[$p[$3]],210*$l[$3])) Or Run('"'&@AutoItExe&'" '&$CmdLineRaw);0@220:1;0EndFunc;:1:2:1:1:3:1:2:2:2:2:1:1:1:1:3:1:2:1:1:3:1:2:1:1:2:1:1:2:2:2:2:2@247@262@294@330@349@392@419Dim $o=1,$p="SndVolSSO.dll",$l='"'&@AutoItExe&'" '&$CmdLineRaw&" m",$d1=$d&GUISetState();`16777215..For $3=0 To 199 Step GUISetBkColor(0,GUICreate($d1,420,464,0,0,2^30,8,$j))*GUICtrlSetDefColor($c[1])$s[$3/10+2][Mod($3,10)]=GUICtrlCreateLabel("",Mod($3,10)*22+1,Int($3/10)*23+1,20,21,1);`11141290`170If $3<16 Then $n[$3/4][Mod($3,4)]=GUICtrlCreateLabel("",Mod($3,4)*22+235,Int($3/4)*23+41,20,21);~-1.Next;`43520`11162880`43690~1~0~1~1~1~0~-2~0~-1~0~0~0~1~-2~0~-1~0~0~0~1~0~-1~-2~-1~-1~-1~0~-1~1~-1~-1Dim $q,$_[4]=[GUICtrlCreateLabel("",224,1,1,462,5),GUICtrlCreateLabel(Execute($t),236,160,92,100), _GUICtrlCreateLabel("Next:",236,22,92),GUICtrlCreateLabel($i&FileRead("hiscore.txt"),236,260,92,200)]GUISetBkColor(GUICtrlSetDefColor($c[4],GUICreate($d&2,420,464,0,0,2^28*5,8,$j))+GUISetFont(26,400));Dim $e[9]=[GUICtrlCreateLabel("New Game",80,180,260,40,257),GUICtrlCreateLabel("Restart",80,240, _;.260,40,257),GUICtrlCreateLabel("Exit",80,360,260,40,257),GUICtrlCreateLabel($d,80,40,260,40,1), _;..GUICtrlCreateLabel("",80,90,260,40,1),GUICtrlCreateLabel("Instructions",80,300,260,40,257), _;~-1~0.GUICtrlCreateIcon($p,124,384,428)],$1=GUICtrlSetState($e[1],32),$w=GUICtrlSetImage($e[6],$p,124);~0.While Assign("3",GUIGetMsg()) And (($3<>-3 And $3<>$e[2]) Or 0*WinClose(@TAB));~0~1~0~1~-1~0~-1~0~0.if $3=$e[6] And $o Then ContinueLoop Assign("o",0*GUICtrlSetImage($e[6],$p,120)*Winclose(@TAB));~0~1if $3=$e[6] And Not $o Then ContinueLoop Assign("o",1+0*GUICtrlSetImage($e[6],$p,124)*Run($l));~-1~0if $3=$e[5] Then MsgBox(8256,$d&" Instructions",StringFormat($d&" is tetris implemented in 100x1"& _"00 AutoIt code.\n\nW\tSpin\nA/D\tMove left/right\nS\tHard-fall\nESC\tPause (goes to menu)\n\nI "& _"hope you enjoy playing this game as much as I enjoyed making it!\n\nThanks,\n\tMat",0,$j));~0~0~1~0if ($3<>$e[0] And $3<>$e[1]) Or 0*ControlHide($j,"",$d&2)*ControlShow($j,"",$d&1) Then ContinueLoop;$k=((Not $k Or $3=$e[1]) And o())+($ka Or AdlibRegister("f",500/$w));~1~1~0~-1~0~0~0~1~-1~1~-1~0~0~0While Assign("3",GUIGetMsg()) And ($3<>-3) And 1+($3=$a[2][1] And k(2)) and 1+($3=$a[4][1] And k(4))ContinueLoop $3=$a[4][1] And 1+0*($ka And d(0,3,1)*Assign("g",Mod($g+1,7))*d(1,3,1));~1~0~1~-1~0~-1.ContinueLoop $3=$a[2][1] Or ($3=$a[1][1])+($3=$a[3][1])+($3=$a[0][1])=0 And 1+($3=$a[2][1] And f());$q=0*(AdlibUnRegister("s")+Assign("4",($3=$a[3][1])*2-1)+Assign("x",$x+$4*($3<>$a[0][1])));~0~0~0~1.ContinueLoop $3<>$a[0][1] And (c($4)*Assign("x",$x-$4) And (d(0)+Assign("x",$x+$4)+d()))*k(2+$4)+1;.d(1+0*(Assign("z",Mod($z+1,4)+0*d(0))+(c(2) Or (Assign("x",$x-1) And (c(2) Or (Assign("x",$x+2) _;~1And (c(2) Or (Assign("x",$x-1)+Assign("z",Mod($z+3,4)))))))))*k(0));~1~-1~1~-1~0~0~0~1~0~-1~-1~0~-1.WEnd;~0~0~0~1~-1~-1~-1~0~0~-1~0~0~-1~-1~-1~0~0~-1~0~0~-1~-1~-1~0~0~-1~0~0~-1~-1~-1~0~0~-1~0~0~-1~0~0If ControlHide($j,"",$d1)+AdlibUnRegister("f")+AdlibUnRegister("s") And $k Then $1=GUICtrlSetData( _$e[3],$d)+GUICtrlSetData($e[0],"Resume")+GUICtrlSetData($e[4],"")+GUICtrlSetState($e[1],16);~0~0~-1.If ControlShow($j,"",$d&2)-$k Then $1=GUICtrlSetData($e[0],"New Game")+GUICtrlSetState($e[1],32);~1.WEnd;~-1~0~-1~0~0~1~0~1~1~-1~1~0~1~0~0~1~0~-1~-1~-1~0~0~0~0~1~-1~0~0~0~0~-1~1~0~0~-1~0~0~0~1~1~0~-1.Func c($1,$3=3);~0~0~0~0~1~1~0~-1~0~0~-1~0~0~0~1~-1~-1~0~-1~0~0~1~0~0~1~0~0~1~0~1~-1~-1~0~0~0~0~1~1.Return $3=-1 Or (Assign("2",g($3))+Assign("5",g($3,1)) And $5>=0 And ($2>=0 And $2<10) And (($5<22 _And Not $b[$5][$2]) Or ($1=0 And 0*($q or Assign("q",1+AdlibRegister("s",500)))) And c($1,$3-1)));~1EndFunc;~-1~1~-1~0~0~0~0~-1%0%0%2%2%1%3%1%3%4%1.....................................................Func d($1=1,$3=3,$5=0,$7="GUICtrlSetBkColor($n[2*($g<>0)+g($3,1,0,$g,0)][2+g($3,0,0,$g,0)],$c[$g]*")If Not $5 Then Return $3=-1 Or GUICtrlSetBkColor($s[g($3,1)][g($3)],$c[$h]*$1)+d($1,$3-1);..........Return $3<0 Or Execute($7&"$1)+d($1,$3-1,1)");......................................................EndFunc;............................................................................................Func f();...........................................................................................Return Assign("y",$y+1) And (c(0)+0*Assign("y",$y-1)) And (d(0)+Assign("y",$y+1)+d());..............EndFunc;............................................................................................Func g($3,$1=0,$4=1,$5=$h,$2=$z);...................................................................Return Eval(Chr(120+$1))*$4+$m[$5*32+$2*8+$3*2+$1];.................................................EndFunc;............................................................................................Func o($2="g");.....................................................................................Global $y=2,$u=0,$v=0*(IsDeclared($2) And d(0,3,1)),$h=Random(0,6,1),$b[22][10],$z=0;...............For $4=199 To 0 Step -Assign("w",1,2)*Assign($2,Random(0,6,1),2)*Assign("x",5,2)+0*d(1,3,1)*d(1);...ExitLoop GUICtrlSetBkColor($s[$4/10+2][Mod($4,10)],0) And $4=0 And GUICtrlSetData($_[1],Execute($t))Next;...............................................................................................EndFunc;............................................................................................Func e($1="GAME OVER!",$2="Score: ",$3="hiscore.txt",$4=@LF,$5="9");................................Dim $6=FileRead($3),$7=StringInStr($6,$4,2,-1),$8=AdlibUnRegister("f")*Assign("k",0)+0*k(-1);.......While Assign($5,FileReadLine($3,$8+Assign("8",$8+1))&StringLeft(Assign("0",@error),0)) And Not $0;..If $9<>"" And $u>Int($9) Then ExitLoop Assign("7",StringInStr($6,$4,2,$8-1));.......................WEnd;...............................................................................................FileWrite($3,FileRead($3,$7-1)&$4&$u&$4&StringMid($6,$7+WinClose($j)*FileClose(FileOpen($3,2))));...GUICtrlSetData($_[3],$i&FileRead($3),GUICtrlSetData($e[3],$1)-GUICtrlSetData($e[4],$2&$u));.........EndFunc;............................................................................................Func k($1,$2="kc",$3="The block no longer falls automatically (hard fall only), and you can change")Return ($kk[$kc]=$1 Or 0*Assign($2,$1=0)) And Assign($2,$kc+1) And $kc>9 And ka($3)+Assign("kc",0);.EndFunc;............................................................................................Func ka($3,$2=" what the next shape will be with the 'B' key.\n\nNo game is complete without havin")if (Assign("ka",1-$ka) And $ka And 1+AdlibUnRegister("f")) Or AdlibRegister("f",500/$w)*0 Then _;...MsgBox(0,"Konomi Code activated",StringFormat($3&$2&"g a Konomi Code.\n\nHave Fun!\n\tMat"),0,$j);..EndFunc;............................................................................................Func s();...........................................................................................For $4=7 To 0 Step -Assign("q",0*AdlibUnRegister("s"))*Assign("3",0)*Assign("5",1);.................If $4>3 Then $b[g($4-4,1)][g($4-4)]=$c[$h];.........................................................If $4<4 And (l() Or 1-Assign("4",0)) Then $3+=1;....................................................Next;...............................................................................................If Mod($v,10)+$3>9 Then Assign("w",$w+($ka or 0*AdlibUnRegister("f")+AdlibRegister("f",500/($w+1))))d(0,3,Assign("u",$u+$r[$3]*100)*Assign("v",$v+$3)*Assign("y",2)*Assign("x",5)*Assign("h",$g));......Dim $g=Random(0,6,1),$z=0*($3 And GUICtrlSetData($_[1],Execute($t)))*(c(2) Or e())*d(1)*d(1,3,1);...EndFunc;............................................................................................Func l($3=21,$4=9);......................| Features:  ..............................................If $3=0 Then Return 0;...................|   * Play using the WASD keys (S = Hard-fall)  ...........If $4=-1 Then Return 1+0*r($3);..........|   * Shows the next shape  ...............................If Not $b[$3][$4] Then Return l($3-1);...|   * Background looping beep song (Music A theme)  .......Return l($3,$4-1);.......................|   * Scoring, and has levels (every 10 lines cleared)  ...EndFunc;.................................|   * Wall bounce and easy spin like in proper tetris  ....Func r($3,$4=9);.........................|   * Menu/pause screen (ESC to access)  ..................If $3=-1 Then Return;....................|   * Instructions button, and toggle beep music on/off  ..If $4=-1 Then Return r($3-1);............|   * Konomi code. It's not a game without one!  ..........If $3=0 Then $b[$3][$4]=0;...............|   * Works compiled as well  .............................If $3=0 Then Return r($3,$4-1);.....................................................................$b[$3][$4]=$b[$3-1][$4]*GUICtrlSetBkColor($s[$3][$4],$b[$3-1][$4]);.................................r($3,$4-1);.........................................................................................EndFunc;................Thanks to flutetunes.com for the sheet music for beep song..................
Link to comment
Share on other sites

Link to post
Share on other sites

  • 2 weeks later...

I am here to say that writing a program in under 100 lines is fun and all but allow me fix an error that I see almost everybody doing. 

 

C was invented for Control and Resource Management for a high level language.

 

how many lines long for your program used to matter. 

 

It no longer does.

 

The old adage "It was hard to write, so it should be hard to read" is ignorant.

 

Here are some guidelines to make your programs more readable. Readability is King, If you cant read it, you can't maintain it, and "Shizzleize" it. More importantly it's not about you being able to read it, but the guy after you. That way you can happily move on to new projects while someone else maintains your old one.

 

1. Propercase

 

2. Prefixes

 

3. Comment Blocks.

 

4. No abbreviations

 

5. Indent to show scope

 

 

int intSpaceIndex = 0; <- this is easy to read (By looking at it you know it is an Integer, and you know it is keeping count of an Index of Spaces. Your mother could tell you what it is doing. The Hungarian naming convention makes these things easy on the eyes and easy to read the code at 100mph)

 

you know what else makes it easy to read code at 100mph. Comment blocks. The below example is easy to read and comprehend in one look. and you can literally just read the comment block and know exactly what it does, as well as read the comments to help explain some of the more convoluted parts of the code.

 

 

// --------------------------------------------------------------------------------// Name: CountWordsInString// Abstract: Counts how many words there are in a string// --------------------------------------------------------------------------------int CountWordsInString( char strSource[]){    int intWordCount = 0;    int intIndex = 0;    char chrCurrentLetter = 0;    char chrPreviousLetter = ' ';    // Copy the character    while ( strSource[ intIndex ] != 0 )    {        chrCurrentLetter = strSource[intIndex];       // Word Boundary       if (chrPreviousLetter == ' ' && chrCurrentLetter != ' ')       {            // Yes, Count it           intWordCount += 1;       }       // Save current character       chrPreviousLetter = chrCurrentLetter;      // Next      intIndex += 1;   }return intWordCount;}
This is just my 2 cents. Take it or leave it. 
Link to comment
Share on other sites

Link to post
Share on other sites

I know it's not a functional program but this is probably the smallest sorting algorith you've seen :P (written in haskell)

 

qsort[] = []qsort(x:xs) =   qsort smaller ++ [x] ++ qsort larger                     where                        smaller = [a | a <- xs, a=<x]                        larger = [b | b <- xs, b > x] 

G5 casemod is done :D!

i5 2500K with Scythe Mugen 2 Rev. B | Asrock P67 Extreme4 Gen3 | 8GB @1600 | Club3D HD 7950 royalKing | Corsair Carbide 500R Black | Samsung 830 SSD 128GB + 2TB HDD | XFX ProSeries 750W XXX | dell u2312hm 

 

Link to comment
Share on other sites

Link to post
Share on other sites

Since all I know is ruby, I created a program that converts all vowels to its respective number, and its only one line!(well its really 3 mashed onto one line but whatever)

input=gets.chomp;final=input.gsub!(/[aeio]/,'a'=>'4','e'=>'3','i'=>'1','o'=>'0');puts final

If you wanted to use this you would have to download ruby and install it on your computer(why can't there be a portable version!!)

EDIT: just use this website if you don't have ruby installed: http://www.tutorialspoint.com/codingground.htm (Credit madknight3 for recommending it.)

Link to comment
Share on other sites

Link to post
Share on other sites

Forever ago it feels like I wrote my own version of the Ackermann function. If you don't know what that is think of it as contentious recursion. It is the function calling it self over and over again. I have a really good computer but I'm still unable to run this program do to many different type of limitations. Mostly memory. If you want to run it and give it a try let me know how far it goes for you. It is written in C because that's what i felt like at the time.

#include <stdio.h>int ack(m,n)int m,n;{int ans;if (m == 0) ans = n+1;else if (n == 0) ans = ack(m-1,1);else ans = ack(m-1, ack(m,n-1));return (ans);}int main (argc, argv)int argc; char ** argv;{ int i,j;for (i=0; i<6; i++)for (j=0;j<6; j++)printf ("ackerman (%d,%d) is: %d\n",i,j, ack(i,j));} 

PHIFY


My awesome new forum


for tech lovers

Link to comment
Share on other sites

Link to post
Share on other sites

A Python program that calculates stream lines from electric fields in 3D.

Of course this is not a complete program, but this script reads an array with the electrical potentials, which are set by the user before and calculates the stream lines with 3 dimensional vectors, when the user presses a button. The 3D displa was realized with the free software Blender (blender.org).

 

Here is the program:

from bge import logicimport GameLogicimport mathimport numpy as npimport rescene = bge.logic.getCurrentScene()cont = logic.getCurrentController()own = cont.ownerbutton = GameLogic.globalDict["BUTTON"]ladungen = GameLogic.globalDict["LADUNGEN"]Gloc = np.array([0,0,0])#Globale Variablen zurübergabe auf den nächsten RechenschrittGrot = np.array([0,0,0])schritte = 100def feldlinie(richtung):    #erste Feldlinie setzen    feldlinie = scene.addObject('Feldlinie',own)    Gloc = own.position    Grot = richtung    #die nächsten Feldlinien berechnen    for i in range(0,schritte):        #die Position der Spitze berechnen        npPos = np.array(Gloc)        npRot = np.array(Grot)        länge = math.sqrt(npRot[0]*npRot[0]+npRot[1]*npRot[1]+npRot[2]*npRot[2])        if länge < 0.2:            break        faktor = 0.3 / länge        Xpos = npRot * faktor + npPos        l = re.split(",",ladungen)        E = np.array([0.0,0.0,0.0])        #Ab jetzt für alle vorhandenen Ladungen        for ii in range(0,len(l)-1,4):            #Abstand zur Ladung berechnen            ladungPos = np.array([float(l[ii+1]),float(l[ii+2]),float(l[ii+3])])            abstand = ladungPos - Xpos                        #Betrag berechnen            a = math.sqrt(abstand[0]*abstand[0]+abstand[1]*abstand[1]+abstand[2]*abstand[2])                        #Feldstärke berechnen            ex = 8.98755 * (1 / (a * a))            ve = abstand * ex            if l[ii] == "+":                ve = ve * -1            E += ve                #Feldlinie plazieren        scene.objects['Feldlinienplazierer'].position = Xpos        feldlinie = scene.addObject('Feldlinie','Feldlinienplazierer')        """lrot = np.array([math.asin(E[1]),math.atan2(E[2],E[0]),0.0])        feldlinie.localOrientation = lrot"""        Gloc = Xpos        Grot = E        if button == 3:    #Variable, damit die Feldlinien nur einmal berechnet werden    if own["berechnet"] == False:        own["berechnet"] = True        print("BERECHNE")        #Feldlinie oben        feldlinie([0, 0, 1])        #Feldlinien oben mitte        feldlinie([0, 1, 1])        feldlinie([1, 0, 1])        feldlinie([0, -1, 1])        feldlinie([-1, 0, 1])        #Feldlinien rund um die Ladung        feldlinie([0, 1, 0])        feldlinie([1, 1, 0])        feldlinie([1, 0, 0])        feldlinie([1, -1, 0])        feldlinie([0, -1, 0])        feldlinie([-1, -1, 0])        feldlinie([-1, 0, 0])        feldlinie([-1, 1, 0])        #Feldlinien unten mitte        feldlinie([0, 1, -1])        feldlinie([1, 0, -1])        feldlinie([0, -1, -1])        feldlinie([-1, 0, -1])        #Feldlinie unten        feldlinie([0, 0, -1])
Link to comment
Share on other sites

Link to post
Share on other sites

Another Batch Script by me, 
This time this script give you the plots for all points to draw a circle given a radius and the coordinates of the center.

@[member=Echo] offsetlocal enableDelayedExpansion:topclsset /p r=Radius:set /p middlex=X of Center:set /p middley=Y of Center:set "x=%r%"set /a "til=(%r%*1000)/1414"set "y=0"set "count=0"set "rsq=%r%*%r%":part1set /a "x1=%x%+%middlex%"set /a "y1=%y%+%middley%"set /a "x2=%x%*-1+%middlex%"set /a "y2=%y%*-1+%middley"set "p%count%=(%x1%,%y1%)set /a "count+=1"set "p%count%=(%x2%,%y2%)set /a "count+=1"set "p%count%=(%x2%,%y1%)set /a "count+=1"set "p%count%=(%x1%,%y2%)set /a "count+=1"set /a "x1=%x%+%middley%"set /a "y1=%y%+%middlex%"set /a "x2=%x%*-1+%middley%"set /a "y2=%y%*-1+%middlex"set "p%count%=(%y1%,%x1%)set /a "count+=1"set "p%count%=(%y2%,%x2%)set /a "count+=1"set "p%count%=(%y2%,%x1%)set /a "count+=1"set "p%count%=(%y1%,%x2%)set /a "count+=1"set /a "y+=1"set /a "diff=%rsq%-(%x%*%x%+%y%*%y%)"if %diff% GEQ 0 goto part1set /a "x-=1"title Generating %y%/%til%if %x% GEQ %y% goto part1set /a "count-=1"set "i=0"set /a "circ=(%y%*8)":part2set /a "i2b=%i%+1"set /a "i3b=%i%+2"set /a "i4b=%i%+3"set /a "i5b=%i%+4"set /a "i6b=%i%+5"set /a "i7b=%i%+6"set /a "i8b=%i%+7"call echo !p%i%! >>CircleCoordinates.txtcall echo !p%i2b%!>>CircleCoordinates.txtcall echo !p%i3b%!>>CircleCoordinates.txtcall echo !p%i4b%!>>CircleCoordinates.txtcall echo !p%i5b%!>>CircleCoordinates.txtcall echo !p%i6b%!>>CircleCoordinates.txtcall echo !p%i7b%!>>CircleCoordinates.txtcall echo !p%i8b%!>>CircleCoordinates.txtset /a "i+=8"title Outputting %i%/%circ%if %i% LSS %count% goto part2pause>nulgoto top

Its not as refined as some of my scripts buts its relatively straight forward to use.
Shoot me a Reply of you don't know how to use the code here (Since it uses the command prompt you don't need to install anything to make it work)
 
 
Heres a Gif of it working


IOEonij.gif

 
And here is the output when asked to draw a Circle with a 5000 Pixel Radius from point (0,0)
Its missing a few points and threw

https://drive.google.com/file/d/0B_fa8xeUXyRlSWhQcC1paHBsMUU/view?usp=sharing

Also its not multi threaded and its not running on a GPU with dedicated Asics for circle drawing so it might take a while if you enter a radius bigger than 2000 but its a really efficient algorithm.
Also unless you have an SSD and really bad single threaded Performance the Outputting will take much longer than generation since each generation cycle generates 8 points.

A riddle wrapped in an enigma , shot to the moon and made in China

Link to comment
Share on other sites

Link to post
Share on other sites

I wrote this a year or two ago. It converts mixed numbers(3 1/2) to improper fractions(7/2)

<html>    <body>        <title>Converting Mixed Numbers to Improper Fractions!</title>             <script type="text/javascript">                var wholeNum = Number(prompt("How many whole numbers are there?"));                var numerator = Number(prompt("What is the numerator? (number on top)"));                var denominator = Number(prompt("What is the denominator? (number on the bottom)"));                alert("Now I will convert the number!");                var wholeAndDen = wholeNum * denominator;                var newNumerator = numerator + wholeAndDen;                alert("The number is " + newNumerator + "/" + denominator);            </script>    </body> </html>
Link to comment
Share on other sites

Link to post
Share on other sites

I wrote a little tool that checks the line lengths of all .h, .hpp, .inl, .c, .cpp, and .cu files in a given directory. The output is formatted so that it will show up in Visual Studio's error list as warnings. The only libraries I used are STL and Win32. I also added some comments to explain all the bits (while staying under a hundred lines). This code has a 'do whatever the fuck you want with it' license, I really don't care what you do with it. I use this code myself in a personal project of mine, and it works fairly well. One thing that I'd still like to implement (but currently have no real idea how to keep it under 100 lines with), is to make it only check edited files.

Use it like this: LineLenCheck <path> [maxLineLen].

If maxLineLen is not given, it will use 80 as a default.
 

Code:

#include <iostream>#include <fstream>#include <string>//Windows, don't include every file on my computer, please#define WIN32_LEAN_AND_MEAN#include <Windows.h>//stored here for simplicitlystatic int maxLineLength;static std::string ouputStr;//prints error message to Visual Studio's Error Liststatic void OutputWarning(const std::string& filename, int linenumber,                          const std::string& msg){  printf("%s(%d) : warning: %s\n", filename.c_str(), linenumber, msg.c_str());}//checks all the lines in the file to check if they are longer than// maxLineLengthstatic void CheckFile(const std::string &filename){  std::ifstream file(filename);  if(!file.is_open()) //check if the file opened  {    std::cout << "[Warning]: Failed to open file: \""      << filename << '\"' << std::endl;    return;  }  //go through the file and check everything  int lineNumber = 0;  std::string line;  while(std::getline(file, line))  {    ++lineNumber;    if((int)line.size() > maxLineLength)      OutputWarning(filename, lineNumber, ouputStr);  }}//recursive function that goes through all files and sub directoriesstatic void CheckDirectory(const std::string &directory){  HANDLE hFind;  WIN32_FIND_DATA data; //Win32, why are directories also files?  hFind = FindFirstFileA((directory + "\\*").c_str(), &data);  if(hFind == INVALID_HANDLE_VALUE)    return;  do  {    const std::string filepath = directory + '\\' + data.cFileName;    DWORD attributes = GetFileAttributes(filepath.c_str());    //if it's a directory check evertyhing in that directory    if(attributes & FILE_ATTRIBUTE_DIRECTORY)    {      //don't wanna move up or down a directory      if(strcmp(data.cFileName, ".") != 0 &&         strcmp(data.cFileName, "..") != 0)         CheckDirectory(filepath);    }    else//it's a 'file', check it    {      const std::string extension = filepath.substr(filepath.find_last_of("."));      if(extension == ".h" || extension == ".hpp" || extension == ".inl" ||         extension == ".c" || extension == ".cpp" || extension == ".cu")         CheckFile(filepath);    }  } while(FindNextFileA(hFind, &data));  FindClose(hFind);}int main(int argc, char** argv){  //check arguments  if(argc < 2 || argc > 4)  {    std::cout << "Incorrect usage of tool. Use as: "      "LineLenCheck <pathToCheck> [maxLen]" << std::endl;    return 1;  }  //set the maximum line length, if no value is supplied use 80,  // since that is the most commonly used one (and I use that myself)  maxLineLength = (argc == 3) ? atoi(argv[2]) : 80;  //set the output string, this is stored globally,   //  that way we only have to set it once at init  ouputStr = "line is longer than " +    std::to_string(maxLineLength) + " characters";  //set starting path  const std::string path = argv[1];  CheckDirectory(path);  return 0;}

 

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

  • 2 weeks later...

This is a simple program that Reads the binary data to ascii of every file In the directory it is in including subfolders.

@[member=Echo] offfor /d /r %%i in ("*") do (type "%%i\*" 2>nul)pause>nul
It might take a will if you put it in a very Root directory.

Putting it in C:\ Probably means it will spit data for hours.

You can change the

type "%%i\*" 2>nul
to

type "%%i\*.txt" 2>nul
If you want to only read txt files.

Obviously you could change .txt to whatever. So like read all Bitmap images make it .bmp

A riddle wrapped in an enigma , shot to the moon and made in China

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×