Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / [DBC] hacking simulation

Author
Message
bass guy1669
17
Years of Service
User Offline
Joined: 24th Mar 2007
Location: The Zone
Posted: 27th Mar 2007 01:59

rem start the computor
input "activate computor y/n",yn$
if yn$="y"
print "computor activated"
goto myhack
else
end
endif

'try to hack computor
myhack:
input "hack computor?",hack$
if hack$="y"
print "hack failed"
goto myspikes
else
end
endif

'use spikes to hack computor
myspikes:
input "use spike",spike$
if spike$="y"
print "computor hacked"
else
end
endif
wait key

thanks to Ianm for helping with the code
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 27th Mar 2007 04:53
computer

RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 27th Mar 2007 16:05
...Doesnt really simulate hacking... at all...

Ankillito
17
Years of Service
User Offline
Joined: 10th Dec 2006
Location: Litigious California
Posted: 29th Mar 2007 10:31
reminds me of the "Hello World!" programs that I learned to program on. This one's less annoying.

"There will always be evil, for, without evil, the good shall lose their virtue."
Veron
17
Years of Service
User Offline
Joined: 22nd Nov 2006
Location:
Posted: 30th Mar 2007 13:07
Clearly, you don't understand what hacking involves. But still, congratulations on what seems like your first program.

Need web design help with PHP or XHTML? E-mail me!
http://veron.sitesled.com Visit Veron! Free games, programs and applications! Made in DBPRO, FPSC, and C++!
bass guy1669
17
Years of Service
User Offline
Joined: 24th Mar 2007
Location: The Zone
Posted: 31st Mar 2007 00:52
its more like a KOTOR style interface
malcom2073
21
Years of Service
User Offline
Joined: 12th Mar 2003
Location:
Posted: 30th Jun 2007 18:19
Heh, someone's watched goldeneye too many times :-P
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 30th Jun 2007 20:09 Edited at: 1st Jul 2007 03:14
[Edit] I've only just realised that this post wasn't a new one (it had died and been resurrected with a recent post). As such I felt that my comments didn't really apply and removed them...

TDK_Man

bass guy1669
17
Years of Service
User Offline
Joined: 24th Mar 2007
Location: The Zone
Posted: 1st Jul 2007 02:10
ummmm why did you bump this thread? why why why?

come see night shift at http://forum.thegamecreators.com/?m=forum_view&t=106003&b=25 see you there
Brain111
17
Years of Service
User Offline
Joined: 5th Feb 2007
Location: In my own little world.
Posted: 9th Jul 2007 06:19 Edited at: 9th Jul 2007 06:20
That's a very good start, now see if you can figure out how to make the program without using the dreaded GOTOs. Usually you use DO...LOOPs and stuff to get around using GOTOS, but in this example you would just want to ask the opposite questions. For example:



Also, it helps to put your code into a code box because it preserves the indents that you put in with Darkbasic (I'm going to give you the benefit of the doubt and assume you did indent it ) You can do this by selecting your code that you pasted and hitting the "code" button all the way on the right of the box while you're making your message.

Anarchy Burger - hold the Government!
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 22nd Jul 2007 18:43 Edited at: 22nd Jul 2007 18:45
The problem with this code, and I think the reason that a lot of noobs use the GOTO command. Is that you are thinking of your program as a book, and each statement must take you from one page to the next.
This linear way of thinking is easy for humans but when coding it is inefficient and quickly becomes messy.

I like the idea of having to "activate" the computer first. Maybe when it's activated you could change the text colour as a visual effect [ink rgb(red,green,blue),background].

You've made a very good program to learn from. I say this because you can easily categorize what you've created: the virtual computer, the hacking function of the computer, and the "use spike" function of the computer. The two functions should be in separate gosubs.

Use Brain111's suggestion for the beginning of the program, this will work and also fits in with the context of your program (your computer isn't going to do anything until you activate it).

Once you have activated the computer, I'd go into a DO LOOP, and think of that loop as the computer in your game.
Instead of just typing "Y" or "N", have the user input "run hack" or "use spike" or words to that effect. Then you can read the string and go to which ever gosub it points to.

I'll be watching for updates

I am king of the noobs!
Angry kreyon
19
Years of Service
User Offline
Joined: 19th Aug 2005
Location:
Posted: 20th Aug 2007 18:33
Hello All.
I was Just Poking around and came across this thread, and while the code that started the thread was simple and rather useless, I got an Idea from it and decided to put together a small program using the base idea which was to create a virtual interface and show some kind of interaction between the user and the interface. after I built the screen locking part, I realized it would be perfect for a locking screen saver, so I built a simple random screen saver to run when the screen is locked, and it also makes the interface have a reason to lock and unlock the screen.

since I did this as a way to show the original author how to better utilize his original idea, I took a lot of time and Commented on almost all the code in the project so that other NewB's would be able to learn something as well. (I know I have learned alot from others who have done the same, so I am following suit.)

anyway here is the code I came up with so far. it's a great start and can be changed in lots of ways to make other programs as well. I have a bunch of ideas that came to mind while getting this far, but I will save them for another time\project.

I will be adding this to the code base as well.



I know that I used the sync command alot but I was having trouble getting the text to appear on screen without it. if anyone knows of a way around this I would like to hear it. (Thanks!)

anyway like I said it's a simple thing but shows lots of promise I think. it requires no outside resources, and runs pretty smooth.

Have Fun!

Login to post a reply

Server time is: 2024-11-22 18:26:43
Your offset time is: 2024-11-22 18:26:43