Qbasicnews.com
December 10, 2019, 08:34:05 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: [1] 2
  Print  
Author Topic: Try this on for size  (Read 6273 times)
Pc72
Forum Regular
**
Posts: 101



WWW
« on: January 15, 2004, 04:00:53 AM »

This is quite easy, though it looks strange:

Program an encryptor in QBasic.
Make the algorithm <15 lines - WITHOUT using the colon.

I will give you a week to work, and then I'll give you my own algorithm for you to see what I meant.

This one is REALLY easy, I'm serious!
Logged

url=http://www.google.com/search?q=%22Ain%27t+I+weird%3F%22&start=10]Ain't I Weird?[/url]
BinarySHOCK
Forum Regular
**
Posts: 117



WWW
« Reply #1 on: January 15, 2004, 06:13:34 AM »

do u mean 15 lines max for all code or for just the encryption routine? also does the encrypter need to encrypt a file or string?

also (if it's just for files) could i program this in a language i wrote in qb? i can provide a interpreter for the langauge altho i cannot release the source of the interpreter yet.
Logged

very F***ing song remains the same
To everyone who sucks-up for the fame
Out of strength you know we speak the truth
Every trend that dies is living proof

MasterMinds Software
KiZ
__/--\__
*****
Posts: 2879


WWW
« Reply #2 on: January 15, 2004, 08:31:20 AM »

You wrote a language in QB? Wicked! What have you written for it? Interpreter? (obviously) Interface? Compiler? Could I get a copy?
Logged
Neo
Na_th_an
*****
Posts: 2150



« Reply #3 on: January 15, 2004, 09:42:02 AM »

Code:
INPUT "Input File: ", InFile$
INPUT "Output File: ", OutFile$
OPEN InFile$ FOR BINARY AS #1
   OPEN OutFile$ FOR BINARY AS #2
      DO
         B$ = " "
         GET #1, , B$
         Z$ = CHR$(ASC(B$) XOR &HF0)
         PUT #1, , Z$
      LOOP UNTIL SEEK(1) = LOF(1)
CLOSE

Very simple, easy to crack, 11 lines. Could be made much better when > 15 lines Wink
Logged
na_th_an
*/-\*
*****
Posts: 8244



WWW
« Reply #4 on: January 15, 2004, 12:50:07 PM »

Quote from: "dark_prevail"
You wrote a language in QB? Wicked! What have you written for it? Interpreter? (obviously) Interface? Compiler? Could I get a copy?


Nice. I began writing one when I was a newbie. It went up to v. 8.5. They featured an IDE and interpreter, but the language was pretty limited. Some time later I coded a fully featured interpreter that had procedural stuff in it, but bleh. Now I code scripts with assembly-like stuff like data movement and conditional branching. Clara from Bulma is using my latest as the main script driver of her upcoming release.
Logged

SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Zack
*/-\*
*****
Posts: 3974



WWW
« Reply #5 on: January 15, 2004, 01:07:31 PM »

Hehe, Neo beat me to it...
There are lots of great algos that fit on one line...Like my 2d encryption technology. Not that I know how to decrypt it, though... :-?
Logged

f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
BinarySHOCK
Forum Regular
**
Posts: 117



WWW
« Reply #6 on: January 16, 2004, 03:24:20 AM »

Quote from: "dark_prevail"
You wrote a language in QB? Wicked! What have you written for it? Interpreter? (obviously) Interface? Compiler? Could I get a copy?


Hmm well it's not fully finished yet, but it's fairly capable...
it was mainly designed so that source files are very small, all commands are 1 byte in length, no gfx commands it's all ascii.

So far a pong game, simple walkaround/battle rpg and a game where u gotta get to a piece of cheese b4 the enemy does

A cheap 'compiler' has been made, it converts the code to qb code and compiles with bc and link, but it still has a few bugs and it'll prolly be scraped as i like using the int for this language, a IDE was started but never finished, u can load/save files and a few other features altho u can't run files from it.

if you want you can add me to your msn contact list and i'll give ya a copy and a few example progs. (binaryshock@hotmail.com)

It's loosely a esoteric language (language meant to be difficult to program in, hence the 1 byte commands) i donno what it is, i just love esoteric langs. this 1 is sorta inbetween esoteric and high level.

oh and btw it's called Smurf (long story behind that).

here's a code sample... don't freak out Tongue

Code:

Cx;  Cy;
Cox; Coy;
Ci;
Cxkey;

@x:40; @y:12;

T0:2; %

T14:2;
Gx:y; P'';

{
 
   &&    
       
   {
      Kxkey;
      ?xkey!0:^;
   }

   Gx:y; P' ';

   ?xkey=75:-x;
   ?xkey=77:+x;
   ?xkey=80:+y;
   ?xkey=72:-y;
   ?xkey=1:^;

   ?x=0:+x;
   ?x=81:-x;
   ?y=0:+y;
   ?y=24:-y;

   T14:2;
   Gx:y; P'';
   
}

E


What this does is, turns the screen green and allows u to move a lil smiley face around.

Smurf is really a cool language once u understand it all, it's really easy. I plan on making some large scale project in it... (obviously not as large scale as qb project could be, but large for smurf)
Logged

very F***ing song remains the same
To everyone who sucks-up for the fame
Out of strength you know we speak the truth
Every trend that dies is living proof

MasterMinds Software
Pc72
Forum Regular
**
Posts: 101



WWW
« Reply #7 on: January 16, 2004, 03:52:56 AM »

This is irrelevant, yet cool.  Yeah, those programming languages... I've had my own language for 3 years now.  It's written in VB, though, and compiles to an ASM file.  Called OPL.  From what I can see, you can very easily use your language for programming the encryptor.  I have used mine back then, so I can't see any big trouble.  But you need file support if you don't have such.  How does your language work, by the way?
Logged

url=http://www.google.com/search?q=%22Ain%27t+I+weird%3F%22&start=10]Ain't I Weird?[/url]
BinarySHOCK
Forum Regular
**
Posts: 117



WWW
« Reply #8 on: January 16, 2004, 03:56:42 AM »

it has file support, yet it still needs string varibles and arrays, and what exactly do u mean by how does it work?

oh and btw Nexinarus (for those of u who may kno him) helped create and test the language.

I've written severeal interpreters for exisiting and new esoteric languages, QuadraF*** is based on the most widely known esoteric language BrainF***, QF is so hard it took me 2 hours to come up with a program that prints BINARY...

here's the code it took for any1 that is interested in seeing it....

Code:

+++++>+++++>>V+*+**+***>>>--->>>>+++++>+>+***
++++>+++++>+V+>V+**+***^**>--^***+++++^+^+***
+++>+++++>+++++.+**+***^**->-^***+++>+^+^+***
++>+++++>++++++*>>V>>v*^**---^***++>++^>^>+**
+>+++++>++++>+>>++.**v.^<.--*^<.*+>+++^<<.>>v
>+++++>++++>+>+*+>>+*>>>>^-->>>^*>++>>>>>^*!.


u think of a QF program like a map each character is a space on the map or a 'tile', and every command moves you over 1 'tile' in a certain direction on the 'map', and if u go off the 'map' you wrap back around to the other side, this can become VERY confusing and extremely difficult, trust me. It is by far the hardest language i've ever programed in, it's funny how some ppl think ASM is hard heh they should try QF.

This next example actually encodes a string the user inputs, it was written in yet another esoteric language i devved called MINI...

Code:

32$ (?^ $ -13) v 32$ (v~ +1 $)


not bad eh? 22byte encrypter!
this langauge is interesting as you only have a stack and 2 internal 'varibles' to store data.

i've also written a langage that's like a pet simulator and a proggin language at the same time, u must take care of a dog and a cat, u get to name them and stuff, there special commands for feeding them playing with them petting em ect. and some normal commands. after so many commands (days) they start to get hungry or need to be played with or they may die or runaway (whichs ends your program) so making programs is quite a challenge, i'd post some code but a hello world example is like 50 lines of code.

it's called COG (Cat dOG).
Logged

very F***ing song remains the same
To everyone who sucks-up for the fame
Out of strength you know we speak the truth
Every trend that dies is living proof

MasterMinds Software
Pc72
Forum Regular
**
Posts: 101



WWW
« Reply #9 on: January 16, 2004, 03:58:35 AM »

Here are the rules again:

The encryption routine should be max. 15 lines - do NOT use colons as line joiners.

The program may be any size.

The program encrypts files.

The program can run in MS-DOS QBasic 1.1.

[/b]
Logged

url=http://www.google.com/search?q=%22Ain%27t+I+weird%3F%22&start=10]Ain't I Weird?[/url]
BinarySHOCK
Forum Regular
**
Posts: 117



WWW
« Reply #10 on: January 16, 2004, 04:32:10 AM »

Added line numbers just so you don't have to count the lines Tongue

Code:

1 OPEN "file to encrypt" FOR BINARY AS #1
2 OPEN "output file" FOR BINARY AS #2
3 Code = 128
4 Bit = 1
5 WHILE NOT EOF(1)
6      A$ = " "
7      GET #1, , A$
8      B$ = CHR$(ASC(A$) XOR (Code AND 255))
9      PUT #2, , B$
10     Code = Code + (((((ASC(A$) + LOF(1)) AND 3)) * Bit))
11     Bit = Bit * 2
12     IF Bit = 128 THEN Bit = 1
13 WEND
14 CLOSE 1, 2

Logged

very F***ing song remains the same
To everyone who sucks-up for the fame
Out of strength you know we speak the truth
Every trend that dies is living proof

MasterMinds Software
Diroga
Been there, done that
*****
Posts: 1087


« Reply #11 on: January 16, 2004, 04:47:24 AM »

what's the adavtage of making your own language. i get it for scripting but QF? that crazy stuff. what do you do for a living BinarySHOCK?  develope software?
Logged
BinarySHOCK
Forum Regular
**
Posts: 117



WWW
« Reply #12 on: January 16, 2004, 04:49:44 AM »

I make em for fun and a challenge, and i'm currently going to school to learn precision machining and welding. software devving is just a hobby i guess you could say.
Logged

very F***ing song remains the same
To everyone who sucks-up for the fame
Out of strength you know we speak the truth
Every trend that dies is living proof

MasterMinds Software
Pc72
Forum Regular
**
Posts: 101



WWW
« Reply #13 on: January 16, 2004, 05:50:35 AM »

Now that this topic has spun out of control anyway, I'd like to introduce you to my own language, OPL - if you wish... But keep in mind, that the encryptor challenge is still on!  I am watching you!  (By the way, good job there, BinarySHOCK)
Logged

url=http://www.google.com/search?q=%22Ain%27t+I+weird%3F%22&start=10]Ain't I Weird?[/url]
BinarySHOCK
Forum Regular
**
Posts: 117



WWW
« Reply #14 on: January 16, 2004, 05:52:19 AM »

hell ya let's see this language!
Logged

very F***ing song remains the same
To everyone who sucks-up for the fame
Out of strength you know we speak the truth
Every trend that dies is living proof

MasterMinds Software
Pages: [1] 2
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!