To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 23695
23694  |  23696
Subject: 
Re: FLL not allowing NQC; Mindscript is allowed
Newsgroups: 
lugnet.robotics
Date: 
Mon, 14 Mar 2005 23:54:19 GMT
Viewed: 
3428 times
  
In lugnet.robotics, Thomas Johnson wrote:
  
   Without additional information can anyone here tell in 10 seconds what the Robolab program does? I highly doubt it.

Actually yes. And it is not equivalent to your programs. This is:




Just to clarify, your sample program is not really equivalent to the two NQC programs I posted. In my two samples I used two tasks and a global variable. Your sample would need to use a container and a task split to truly be equivalent.

   The CEEO example you cite is much more complex. It loops, playing 1 tone while the touch sensor is released, and a 2nd tone while the touch sensor is pressed. Once the 2nd tone has played 6 times, a final third tone plays. Note that it has nothing to do w/the number of times the sensor is clicked.

After looking closely at all the sample programs at the CEEO Robolab website I think I’ve figured out enough Robolab syntax to define a true NQC equivalent. Here is my best guess:
#define C 262

task main()
{

  int yellow = 0;

red:
  if (!SENSOR_1)
    PlaySound(0);
  else
  {
    PlaySound(3);
    yellow += 1;
  }
  if (yellow > 5)
    PlayTone(C, 50);
  else
    goto red;

}
As you can see it is a very trivial NQC program which even uses the “goto” keyword to correctly emulate (so far as I can determine) the Jump/Land concept in Robolab (as well as its color-coded aspect) and it names the container based on the color used in the Robolab program. Unfortunately it isn’t completely clear what sound is played when a value is not attached to the play sound icon (I’m guessing that it is sound zero) or whether there is an implied wait of some sort built into the icon. And there is no way for me to know how long the note C is played (or which octave to use). Fortunately, in the NQC program this is all quite clearly specified for the judges to see in a plain text. A normal NQC program (i.e., one not written to simulate the cryptic nature of Robolab programs) would look more like this:
#define C4 262
#define half_a_second 50

task main()
{
  int SoundUpCount = 0;

  while (true)
  {
    if (SENSOR_1)
    {
      PlaySound(SOUND_UP);
      SoundUpCount++;
    }
    else
      PlaySound(SOUND_CLICK);

    if (SoundUpCount > 5)
      break;
  }
  PlayTone(C4, half_a_second);
}
Here’s that original image for comparison:



John Hansen



Message has 2 Replies:
  RE: FLL not allowing NQC; Mindscript is allowed
 
As a robotics teacher and FLL coach who teaches kids from 7-15 all year 'round, I find ROBOLAB just great. And, while dating myself somewhat, I've programmed with BASIC, FORTRAN, PL/I, and a few other languages. And while I'm the sort that can (...) (20 years ago, 15-Mar-05, to lugnet.robotics)
  Re: FLL not allowing NQC; Mindscript is allowed
 
On Mon, March 14, 2005 6:54 pm, John Hansen said: (...) ... (...) Double-clicking the icon in Robolab shows the help. The default value for the playsound is 6 (fast rising sweep) and 3 is decending sweep. (20 years ago, 15-Mar-05, to lugnet.robotics)

Message is in Reply To:
  Re: FLL not allowing NQC; Mindscript is allowed
 
(...) Complete agreement. But it is unfortunately not the case. (...) Actually, they would only need to move the curser over any symbols they were unfamiliar with. The contextual help will spell it out for them. (...) Actually yes. And it is not (...) (20 years ago, 10-Mar-05, to lugnet.robotics, FTX)

114 Messages in This Thread:
(Inline display suppressed due to large size. Click Dots below to view.)
Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR