Qbasicnews.com
November 13, 2019, 11:18:55 PM *
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: I have a new challenge  (Read 7106 times)
Oz
I hold this place together
*****
Posts: 923



« on: March 28, 2003, 06:49:00 PM »

Im not a good programmer, so if someone could help me out with my programming, that would be the ultimate challenge...I know what your thinking...Read a tutorial, but I don't pick up information easily that way.  I need it in a way that i understand.

  As a qbasic challenge, create an effective, 3d weapon engine.

  Needs:
  Rotatable by keyboard
  no flicker - deducts from effectiveness
  effective colour
  shading
  In qbasic (duh!)


  Script can be as long as you want, but the more chinese it is to me, the harder it will be to analyze


Challenge no. 2
  Create a qbasic translator (ex English to Dutch)
 
  Some hints:
  INSTR(text$ + kbrd$), " ")
  for letter 1 to wordsize
  MID$((text$ + kbrd$), 1, wordsize) = translation$

  I've done some of this, and it works pretty good, but it is a little slow, but for that fact, my computer is slow.


Good luck

 :lol: Alex :lol:
Logged
toonski84
__/--\__
*****
Posts: 2567



« Reply #1 on: March 28, 2003, 07:15:02 PM »

... i dont think that's a great challenge.  or at least asking someone to do what would take weeks to months of work.  if you cant do it, or you arent willing to accept people's help learning it, then you should make gradually more complex projects till your ready.  test your abilities to what you can and can learn to do.
Logged

i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry
Hexadecimal Disaster
Been there, done that
*****
Posts: 1123



« Reply #2 on: March 28, 2003, 11:56:53 PM »

I have to agree with Toonski about that, with the exception of the "I dont think that's a great challenge" part, unless you were talking about the "challenge" to learn from other people's source code, in which case I have to agree again.

3D weapon engine... *duh* ...a raytracer should I suppose?  :-?

And about the translator thingo, if the requirement it's just some sort of dictionary, then that's easy as hell (it's just a relational database), but if you're talking about a real translator, that's a incredibly difficult thing to do. Seriously.

As a matter of fact, even the most advanced software translation package isn't capable of translating a simple paragraph from english to spanish or viceversa with a 100% of accuracy. Remember than the program also should be capable of recognize the context where the word was used, grammatical structures and a lot of things. So... to make a good one is a great challenge.
Logged

img]http://usuarios.vtr.net/~disaster/sigs/annoyizer.php[/img]
oracle
*/-\*
*****
Posts: 3652



WWW
« Reply #3 on: March 30, 2003, 09:27:47 PM »

Check out the babelfish forum here to see how hard this project would be.

Here is another idea - I can prove that the RND function is not really random. We all already know this (and if not I'll explain) but can you prove it by somehow tallying the results of many RND results (using RANDOMIZE TIMER)?

Here's a clue: think visually[/url]
Logged

BinarySHOCK
Forum Regular
**
Posts: 117



WWW
« Reply #4 on: April 01, 2003, 02:09:15 AM »

CLS
FOR i = 1 TO 10: GOSUB RND1: NEXT i
PRINT "------"
Seed# = y#(1)
FOR i = 1 TO 10: GOSUB RND2: NEXT i
SYSTEM

RND1: ' ***** ***** This is the number produced by RND
y#(i) = RND * 16777216
PRINT y#(i)
RETURN

RND2: ' ***** ***** This is the number produced by zombie
PRINT Seed#
Temp# = (16598013# * Seed# + 12820163)
Seed# = Temp# - INT(Temp# / 16777216) * 16777216
RETURN
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
Oz
I hold this place together
*****
Posts: 923



« Reply #5 on: April 01, 2003, 01:52:02 PM »

Cheesy    The 3d weapon was wrong.......I was talking to someone on msn, but I wasn't really paying attention to the screen, just typing.

The real thing i wanted was a 3d face.
      `->using simple features, building a skeleton of a face, and overlaying the textures..

--->Keep it simple(features)

 :normal: Al :normal:
Logged
oracle
*/-\*
*****
Posts: 3652



WWW
« Reply #6 on: April 02, 2003, 12:21:30 AM »

BinaryShock: You didn't use RANDOMIZE TIMER, did you? Of course it will always be the same output (unless you didn't post all your prog).

Clue 2: I used SCREEN 13.....
Logged

relsoft
*/-\*
*****
Posts: 3927



WWW
« Reply #7 on: April 02, 2003, 01:57:12 AM »

Quote from: "Alex_at_EverNever"
Cheesy    The 3d weapon was wrong.......I was talking to someone on msn, but I wasn't really paying attention to the screen, just typing.

The real thing i wanted was a 3d face.
      `->using simple features, building a skeleton of a face, and overlaying the textures..

--->Keep it simple(features)

 :normal: Al :normal:


Easy, just draw it on a modeller and load it to QB.
Render it any way you want.
Logged

y smiley is 24 bit.


Genso's Junkyard:
http://rel.betterwebber.com/
Neo
Na_th_an
*****
Posts: 2150



« Reply #8 on: April 02, 2003, 06:31:45 AM »

MilkShape e.g.
The only thing you gotta know then is the file format
Logged
BinarySHOCK
Forum Regular
**
Posts: 117



WWW
« Reply #9 on: April 03, 2003, 01:56:09 AM »

Oracle: even with randomize timer, it still isn't random, all it does it sets a seed for 'random' numbers equal to how many seconds has elapsed since midnight. nothing more nothing less
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
aphex
New Member

Posts: 4


WWW
« Reply #10 on: April 03, 2003, 07:08:10 AM »

nah, qb's random number generator is rubbish. I'll skip over the fact that you can't ever generate truely random numbers, but there are better techniques. Anyway, here's a piece of code I wrote that kinda matches the quality of QB's:

          Seed           dw    ?
          MulVal         dw    7361h  ; Some prime number

rand proc
   mov  ax, Seed
   mov  dx, MulVal
   mul  dx
   inc  ax
   mov  Seed, ax
   ret
rand endp


So you can imagine why it's so crap..

As far as this challenge goes..umm..I think you're a wee bit inexerienced to be placing coherent challenges Smiley
Logged
Hexadecimal Disaster
Been there, done that
*****
Posts: 1123



« Reply #11 on: April 03, 2003, 08:36:47 PM »

I recall this observation about the QB RND function:

Quote
The function RND will produce a series of 16,777,206 random numbers and then repeat. These numbers are the only ones ever produced by RND.

Issuing the command RANDOMIZE TIMER will not change anything except the point in the series to start. This increases the surprise-factor however.
Logged

img]http://usuarios.vtr.net/~disaster/sigs/annoyizer.php[/img]
Agamemnus
x/ \z
*****
Posts: 3491



« Reply #12 on: April 04, 2003, 01:28:47 AM »

Here's another one I am uncertain about:

Given a size A, find the largest B such that
2^(B-1) < A < 2^B.

So, find the ceiling of the log((base2) n) of a number as quickly as algorithmically possible.
Logged

Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
oracle
*/-\*
*****
Posts: 3652



WWW
« Reply #13 on: April 04, 2003, 03:00:36 AM »

Well the only way to get better random numbers is to do a "randomize timer" statement before you set any random variables. Microsoft's GORILLA.BAS shows a good randomize function that should be made standard in all progs with random variables:

Code:

FUNCTION ran (x, c)

RANDOMIZE TIMER

ran = INT(RND * x) + c

END FUNCTION


Anyone got any other ideas for randomizing variables?
Logged

LooseCaboose
I hold this place together
*****
Posts: 981



« Reply #14 on: April 05, 2003, 03:20:13 AM »

<digs notes out on random variables>

I cant find all my notes at the moment, but from memory random variables are generated from fairly simple algorithms using very large prime numbers. The main goals of a good random variable generator are to have a large cycle length and for each value to have statistical independance from the others (ie cant make predictions about the next number given the last few).

Of course no algorithmic generator can ever produce truely random numbers (because its based on a formula), but if the cycle length is long enough and statistical independance is achieved then it becomes difficult or impossible to tell that the sequence isnt random.

Quote

I'll skip over the fact that you can't ever generate truely random numbers


Thats not entirely true, it is accurate if you are refering to random numbers generated with computers which are usually formula based and use the timer to generate a seed value, however there have been studies done in using natural or real world phenomena to generate random numbers. I have seen work done with random numbers generated by using a digital camera and a lava-lamp, the pictures were assigned a unique number by combining the values of each pixel. The numbers generated will have a finite cycle length, but a lava-lamp doesn't obey any formula for its behaviour so theoritcally the numbers should be completely random. Other studies have done similar experiments with other objects as random number generators.
Logged

esus saves.... Passes to Moses, shoots, he scores!
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!