Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
-
dudmaster
- Posts: 171
- Joined: 06 Oct 2010, 02:38
- Location: Texas, Santa Fe
-
Contact:
Post
by dudmaster »
I have a problem this code:
Code: Select all
void Mapper(int FrontUltrasonic, int LeftUltrasonic, int RightUltrasonic, int CityMap[16][16])
{
}
task main()
{
}
And I think it is a bug.
This code works:
Code: Select all
void Mapper(int FrontUltrasonic, int LeftUltrasonic, int RightUltrasonic)
{
}
task main()
{
}
2Labz.com, My Website
-
muntoo
- Posts: 834
- Joined: 01 Oct 2010, 02:54
- Location: Your Worst Nightmare
-
Contact:
Post
by muntoo »
You can't put those 16s in there. 42 is a different story...
Code: Select all
void Mapper(int CityMap[][], int FrontUltrasonic, int LeftUltrasonic, int RightUltrasonic)
{
unsigned int CM_d1 = ArrayLen(CityMap);
if(CM_d1 < 16)
return;
unsigned int CM_d2 = ArrayLen(CityMap[0]);
if(CM_d2 < 16)
return;
// YOUR CODE HERE
}
task main()
{
int buf[];
int CityMap[][];
ArrayInit(buf, NULL, 16);
ArrayInit(CityMap, buf, 16);
Mapper(CityMap, 0, 0, 0);
}
Commit to LEGO Mindstorms Robotics Stack Exchange:
bit.ly/MindstormsSE
Commit to LEGO Stack Exchange:
bit.ly/Area51LEGOcommit
-
dudmaster
- Posts: 171
- Joined: 06 Oct 2010, 02:38
- Location: Texas, Santa Fe
-
Contact:
Post
by dudmaster »
Thanks. This was for my friend's FLL project, but he got stuck on this code. I'll E-Mail him.
2Labz.com, My Website
-
afanofosc
- Site Admin
- Posts: 1256
- Joined: 26 Sep 2010, 19:36
- Location: Nashville, TN
-
Contact:
Post
by afanofosc »
I'm pretty sure you can't use NXC in FLL. Unless they've changed the rules or something.
John Hansen
Users browsing this forum: No registered users and 2 guests