Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Help Open Turing
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
velotin




PostPosted: Sun Jul 22, 2012 10:09 am   Post subject: Help Open Turing

What is the physic limit of Open Turing 1.0 ?
(Max size of a program, max number of variables etc...)

My program do not turn. Is-it too big ?

Open Turing is-it limited ?

Thank you for your help

B. V.
Sponsor
Sponsor
Sponsor
sponsor
DemonWasp




PostPosted: Sun Jul 22, 2012 10:53 am   Post subject: RE:Help Open Turing

I don't think there are any published limits on OpenTuring. Obviously, there are some limits on what the hardware of your machine can do.

What error message are you getting when you try to run your program?
velotin




PostPosted: Sun Jul 22, 2012 2:09 pm   Post subject: RE:Help Open Turing

My hardware is good (hard gamer)
==> Intel Core i7 Extreme 990X
==> RAM DDR3 12288 Mo
==> NVIDIA GeForce GTX 590

Error message ==> "Ident failed" "Not enough memory to ident file"

Also, my menu is out of command.

Thank you for your reply

Excuse me, my english is very bad

B. V.
velotin




PostPosted: Sun Jul 22, 2012 2:25 pm   Post subject: RE:Help Open Turing

I complte ==> I use windows 7 64 bits (compatible ?)

B. V.
crossley7




PostPosted: Sun Jul 22, 2012 3:03 pm   Post subject: RE:Help Open Turing

The not enough memory to indent file is an error that generally comes from really long files and doesn't specifically have anything to do with variables. It also won't affect your program so if you want it indented, just do it yourself is what I would recommend.
evildaddy911




PostPosted: Sun Jul 22, 2012 3:52 pm   Post subject: RE:Help Open Turing

"Not enough memeory to indent file" means that one of the lines is WAAY too long. if that happens, find the longest line, and just before the 200th character (in between words) hit enter. then try the indent; it should work fine now
trishume




PostPosted: Sun Jul 22, 2012 9:52 pm   Post subject: RE:Help Open Turing

Many people are bugged by this.
The new editor I have written does not have this problem, all though it does not format the code, only indents it.
Tony




PostPosted: Sun Jul 22, 2012 10:01 pm   Post subject: RE:Help Open Turing

Although many code-style guidelines will suggest to keep line length well below the length where the issue occurs. If a piece of code runs off the window into a horizontal scroll (or even wraps the line at some arbitrary point), it negatively impacts that code's readability.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Sponsor
Sponsor
Sponsor
sponsor
velotin




PostPosted: Mon Jul 23, 2012 2:12 pm   Post subject: RE:Help Open Turing

Thank you for evildaddy911.
One line was too long and I cut it with enter.
The indent work !!!
But my menu in my program alway do not work.
I wrote a graphic game in ADA with the library JEWL (1 100 lines).
It run fine but it flicker (refresh problem with WINDOWS which is not possible to correct in JEWL).
Others libraries like gtkada, qtada being difficult to use, I want to transfert my program in Open Turing because there are View.Set ("offscreenonly") and ViewUpdate area (double buffer).
My menu work when my Turing program was short at the beginning of transfert but now, it do not work.
B. V.
Tony




PostPosted: Mon Jul 23, 2012 3:12 pm   Post subject: RE:Help Open Turing

Description such as "does not work" are not useful, as in doesn't carry any information regarding why it might be that way. In which way does it not work? Can you isolate that to some minimal example (a case that demonstrates only the problem, not your entire program)?
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
velotin




PostPosted: Tue Jul 24, 2012 2:35 pm   Post subject: Re: Help Open Turing

I put below a case of my program that demonstrates only the problem (in french of course !!!)

The menu do not work (program too big ???)

----------------------------------------------------------------------------------------------------------
import GUI

/* Les variables globales */

type cell :
record
val : char
trou : int
end record

type tab : array 1 .. 12 of cell

type caj : array 1 .. 6 of int

type j0 : enum (xhum, xord, xfin)

var tab0 : tab
var procou : int
var joueur : j0
var chum : int

const trou : array 1 .. 12, 1 .. 2 of int := init (117, 190, 199, 190, 280, 190, 361, 190, 442, 190, 523, 190, 523, 290, 442, 290, 361, 290, 280, 290, 199, 290, 117, 290)

const decal : array 1 .. 59, 1 .. 2 of int := init (0, 30, 7, 29, 14, 26, 20, 22, 24, 16, 28, 10, 29, 3, 29, -4, 27, -11, 24, -17, 19, -22, 13, -26, 6, -29, -1, -29, -8, -28, -15, -25, -20, -21, -25,
-15, -28, -9, -29,
- 2, -29, 5, -27, 12, -23, 18, -18, 23, -12, 27, -5, 29, 0, 22, 7, 20, 14, 16, 19, 9, 21, 2, 21, -5, 17, -12, 11, -18, 4, -21, -3, -21, -11, -19, -17, -13, -20, -6, -21, 1, -20, 8, -15, 15, -8,
20, 0, 14, 7, 11, 12, 6, 13, -1, 11, -8, 4,
- 13, -2, -13, -9, -10, -13, -3, -13, 4, -8, 10, 0, 6, 5, 1, 2, -5, -4, -4, -5, 3)

var libre : array 1 .. 12, 1 .. 59 of int

var x0 : array 1 .. 8 of int := init (90, 70, 70, 90, 550, 570, 570, 550)
var y0 : array 1 .. 8 of int := init (140, 160, 320, 340, 340, 320, 160, 140)

var font0, font1 : int
font0 := Font.New ("arial:20:bold")
font1 := Font.New ("arial:16:bold")

% ID fenetre principale
var winID : int

% variables menu
var Jeu, Opt, Help : int
var item : array 1 .. 6 of int
var nom : array 1 .. 6 of string (8) := init ("Lancer", "Quitter", "Niveau", "Premier?", "Regles", "A propos")

% Variables de travail
var trav : nat

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Procedures et fonctions graphiques


procedure dtrou (t0 : int)
View.Set ("offscreenonly")
Draw.FillOval (trou (t0, 1), trou (t0, 2), 35, 35, black)
View.UpdateArea (trou (t0, 1) - 36, trou (t0, 2) + 36, trou (t0, 1) + 36, trou (t0, 2) - 36)
end dtrou

procedure dpion (t0 : int)
var i0 : int
View.Set ("offscreenonly")
loop
randint (i0, 1, 59)
exit when libre (t0, i0) = 0;
end loop
Draw.FillOval (trou (t0, 1) + decal (i0, 1), trou (t0, 2) + decal (i0, 2), 3, 3, brown)
View.UpdateArea ((trou (t0, 1) + decal (i0, 1)) - 4, (trou (t0, 2) + decal (i0, 2)) + 4, (trou (t0, 1) + decal (i0, 1)) + 4, (trou (t0, 2) + decal (i0, 2)) - 4)
libre (t0, i0) := 1
end dpion

procedure dpion2 (t0 : int) % procedure dpion2 pour dessiner en rouge les pions bloques (et les bloquer avec le code 2)
var i0 : int
View.Set ("offscreenonly")
loop
randint (i0, 1, 59)
exit when libre (t0, i0) = 0;
end loop
Draw.FillOval (trou (t0, 1) + decal (i0, 1), trou (t0, 2) + decal (i0, 2), 3, 3, brightred)
View.UpdateArea ((trou (t0, 1) + decal (i0, 1)) - 4, (trou (t0, 2) + decal (i0, 2)) + 4, (trou (t0, 1) + decal (i0, 1)) + 4, (trou (t0, 2) + decal (i0, 2)) - 4)
libre (t0, i0) := 2
end dpion2

procedure effac (t0 : int)
View.Set ("offscreenonly")
for i0 : 1 .. 59
if libre (t0, i0) = 1 then % si 0 ou 2, pas d'effacement necessaire (2 = singleton bloque)
Draw.FillOval (trou (t0, 1) + decal (i0, 1), trou (t0, 2) + decal (i0, 2), 3, 3, black)
end if
end for
View.UpdateArea (trou (t0, 1) - 36, trou (t0, 2) + 36, trou (t0, 1) + 36, trou (t0, 2) - 36)
tab0 (t0).trou := 0;
end effac

procedure majcompt
var compth, compto : int

compth := 0
compto := 0
for i0 : 1 .. 12
case tab0 (i0).val of
label 'O' :
compto := compto + tab0 (i0).trou
label 'H' :
compth := compth + tab0 (i0).trou
label :
end case
end for
View.Set ("offscreenonly")
Draw.FillOval (43, 242, 18, 18, brightmagenta)
Draw.Text (intstr (compto, 2, 10), 32, 235, font1, black)
View.UpdateArea (23, 262, 63, 222)
Draw.FillOval (599, 242, 18, 18, brightgreen)
Draw.Text (intstr (compth, 2, 10), 587, 235, font1, black)
View.UpdateArea (579, 262, 619, 222)
Font.Free (font1)
end majcompt

procedure init0
% Initialisation variables globales
for i0 : 1 .. 12
for i1 : 1 .. 59
libre (i0, i1) := 0
end for
end for
% Initialisation table de jeu
Draw.Text ("||||| TEST |||||", 225, 410, font0, black)
Font.Free (font0)

Draw.FillPolygon (x0, y0, 8, RGB.AddColor (0.57, 0.32, 0.15))
Draw.Polygon (x0, y0, 8, black)


Draw.ThickLine (320, 155, 320, 325, 3, black)
Draw.ThickLine (320, 240, 95, 240, 3, black)
Draw.ThickLine (320, 240, 545, 240, 3, black)

Draw.ThickLine (155, 148, 245, 148, 3, brightgreen)
Draw.ThickLine (155, 148, 165, 143, 3, brightgreen)
Draw.ThickLine (155, 148, 165, 153, 3, brightgreen)
Draw.ThickLine (485, 148, 395, 148, 3, brightgreen)
Draw.ThickLine (485, 148, 475, 143, 3, brightgreen)
Draw.ThickLine (485, 148, 475, 153, 3, brightgreen)

Draw.ThickLine (155, 332, 245, 332, 3, brightmagenta)
Draw.ThickLine (155, 332, 165, 327, 3, brightmagenta)
Draw.ThickLine (155, 332, 165, 337, 3, brightmagenta)
Draw.ThickLine (485, 332, 395, 332, 3, brightmagenta)
Draw.ThickLine (485, 332, 475, 327, 3, brightmagenta)
Draw.ThickLine (485, 332, 475, 337, 3, brightmagenta)
% Mise en place des trous initiaux
for i0 : 1 .. 12
dtrou (i0)
end for
% Mise en place des pions initiaux et inialisation du tableau tab0
for i0 : 1 .. 12
for i1 : 1 .. 4
dpion (i0)
end for
tab0 (i0).val := 'V'
tab0 (i0).trou := 4
end for
% Mise a jour des compteurs
majcompt
end init0

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Procedures et fonctions non graphiques

function finjeu (tab0 : tab) : boolean
var drap : boolean
drap := true
for i0 : 1 .. 12
if tab0 (i0).val = 'V' and tab0 (i0).trou > 0 then
drap := false
end if
end for
result drap
end finjeu

procedure humain

end humain

% Six procedures pour les items du menu

procedure moniteur
var drap : boolean
drap := false
loop
case joueur of
label j0.xhum :
if finjeu (tab0) then
joueur := j0.xfin
else
Draw.Text ("A vous de jouer !", 300, 200, defFontID, brightred)
humain
if chum not= 0 then
joueur := j0.xord
end if
end if
label j0.xord :

label j0.xfin :
drap := true
end case
exit when drap = true
end loop

end moniteur

procedure fin
GUI.Quit
GUI.CloseWindow (winID)
end fin

procedure niveau
end niveau

procedure premier
end premier

procedure regle
end regle

procedure apropos
end apropos


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% PROGRAMME PRINCIPAL
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Open the window

winID := Window.Open ("position:middle;center,graphics:640;480,title:test,nobuttonbar")
RGB.SetColor (0, 1.00, 0.91, 0.72)
cls


% Creation des menus
Jeu := GUI.CreateMenu ("Jeu")
item (1) := GUI.CreateMenuItem (nom (1), moniteur)
item (2) := GUI.CreateMenuItem (nom (2), fin)
Opt := GUI.CreateMenu ("Options")
item (3) := GUI.CreateMenuItem (nom (3), niveau)
item (4) := GUI.CreateMenuItem (nom (4), premier)
Help := GUI.CreateMenu ("Aide")
item (5) := GUI.CreateMenuItem (nom (5), regle)
item (6) := GUI.CreateMenuItem (nom (6), apropos)

init0

loop
exit when GUI.ProcessEvent
end loop

GUI.Quit
GUI.CloseWindow (winID)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

B. V.
Dreadnought




PostPosted: Tue Jul 24, 2012 3:08 pm   Post subject: Re: Help Open Turing

For me the worst part about using Turing in French was that the editor doesn't support the accents (so many of my comments looked very weird).

Anyway, it seems you're running in offscreenonly mode. This does not appear to work very well with the menu widgets (I don't think they call View.Update). Although in all honesty, I never use the Turing GUI (personal preference).
Removing the View.Set("offscreenonly") lines fixed it for me.

Note that if you do want your window to be in offscreenonly mode you should just make it another parameter to Window.Open, but this will still break your menu.
trishume




PostPosted: Tue Jul 24, 2012 9:57 pm   Post subject: Re: Help Open Turing

Ya the fact that the GUI module does not support offscreenonly sucks. I wrote my own version that looks nicer and supports offscreenonly once.
It also had a rich text view.

Maybe I should release it... If I can find it.
velotin




PostPosted: Wed Jul 25, 2012 4:08 am   Post subject: RE:Help Open Turing

Thank you to Dreadnought.

It is easy for me to correct this stupid bug in my program.

It is difficult to learn a new language.

There are always pits and traps to fall in.

B. V.
velotin




PostPosted: Wed Jul 25, 2012 4:08 am   Post subject: RE:Help Open Turing

Thank you to Dreadnought.

It is easy for me to correct this stupid bug in my program.

It is difficult to learn a new language.

There are always pits and traps to fall in.

B. V.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 15 Posts ]
Jump to:   


Style:  
Search: