Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Otros entornos y lenguajes > C++ Builder
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

 
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 06-03-2009
torrescrack9 torrescrack9 is offline
Registrado
 
Registrado: feb 2009
Posts: 5
Poder: 0
torrescrack9 Va por buen camino
duda juego c++ builder 2007

Estoy haciendo el juego de simon dice en c++ builder 2007 y tengo la siguiente duda debo dimensionar un vector y he probado de un monton de formas y no soi capaz me da un error....

Mira pongo el codigo aver si alguien sabe a q se debe el error...

Lo que kiero es dimensionar las variables vector y vectorentrada

El error que me sale es el siguiente:

Cita:
---structure required on left side of. or .

--- invalid direction
Código:
#include <vcl.h>
#pragma hdrstop
#include "Unit2.h"
int repeticiones;
int contador;
short vector;
short vectorentrada;
int i;
const short limiteinf=1;
const short limitesup=4;
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm2 *Form2;
void colores_iniciales()
 {
  Form2->I_1->Picture=Form2->I_gris1->Picture;
  Form2->I_2->Picture=Form2->I_gris2->Picture;
  Form2->I_3->Picture=Form2->I_gris3->Picture;
  Form2->I_4->Picture=Form2->I_gris4->Picture;
 }
void aleatorio(short limiteinf,short limitesup)
 {
  short aleatorio=0;
  Randomize();
  aleatorio=Int((limitesup-limiteinf+1)*Random()+limiteinf);
 }
void inicio()
{
 //int i;
 vector.redim(repeticiones);
 vectorentrada.redim(repeticiones);
 for(i=1;i<repeticiones;i++)
 {
  vector[i] = aleatorio(limiteinf,limitesup);
 }
 Form2->I_1->Enabled=false;
 Form2->I_2->Enabled=false;
 Form2->I_3->Enabled=false;
 Form2->I_4->Enabled=false;
 Form2->Juego1->Enabled=false;
 Form2->Acerca1->Enabled=false;
 Form2->Secuenciador->Enabled=true;
 contador=1;
}
//---------------------------------------------------------------------------
__fastcall TForm2::TForm2(TComponent* Owner)
 : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm2::FormShow(TObject *Sender)
{
colores_iniciales();
repeticiones=1;
}
//---------------------------------------------------------------------------
void __fastcall TForm2::Nuevo1Click(TObject *Sender)
{
inicio();
}
//---------------------------------------------------------------------------
void __fastcall TForm2::SecuenciadorTimer(TObject *Sender)
{
colores_iniciales();
if(contador<=repeticiones)
 {
  L_Contador->Caption=contador;
  switch((vector[contador]))
   {
    case 1:
      I_1->Picture=I_rojo->Picture;
      break;
    case 2:
      I_2->Picture=I_azul->Picture;
      break;
    case 3:
      I_3->Picture=I_Amarillo->Picture;
      break;
    case 4:
      I_4->Picture=I_Verde->Picture;
      break;
   }   // fin switch;
   contador=contador+1;
  }
else  {
   L_Contador->Caption="";
   contador=1;
   Secuenciador->Enabled=false;
   I_1->Enabled=true;
   I_2->Enabled=true;
   I_3->Enabled=true;
   I_4->Enabled=true;
  }
}
//---------------------------------------------------------------------------
void __fastcall TForm2::BorradorTimer(TObject *Sender)
{
colores_iniciales();
Borrador->Enabled=false;
}
//---------------------------------------------------------------------------
void __fastcall TForm2::Salir1Click(TObject *Sender)
{
Form2->Close();
}
//---------------------------------------------------------------------------

Última edición por dec fecha: 06-03-2009 a las 14:55:39. Razón: Poner las etiquetas QUOTE y CODE
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
juego c++ builder torrescrack9 Gráficos 2 27-02-2009 17:34:17
juego c++ builder torrescrack9 C++ Builder 1 26-02-2009 19:52:07
instalacion de zeos lib en c++ builder 2007 2-D@monic C++ Builder 0 18-05-2008 06:55:52
C++ Builder 2007 rruz Noticias 0 15-05-2007 08:39:33
Duda sobre como programar el juego Timbiriche mifiar Varios 16 26-11-2005 06:06:01


La franja horaria es GMT +2. Ahora son las 17:32:15.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi