Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   Share Worlds (http://www.alice.org/community/forumdisplay.php?f=6)
-   -   Tic-Tac-Toe! (http://www.alice.org/community/showthread.php?t=3548)

x2495iiii 06-04-2010 01:26 AM

[QUOTE=cooki3monst3r77;21954]I apologize. There was a misunderstanding between the friend and I. Apparently he got it from a teacher who couldnt explain how things worked on it and my friend was trying to turn it in as a project in my school, saying that he was the one that created it. Now I feel like a real douche. I am truly sorry. We are trying to recreate this tic tac toe in school and I am f#@#$# STUMPED. Even looking at your code. GOOD JOB.[/QUOTE]

Very honorable of you.

chinchli57 12-04-2010 08:46 PM

folders in details window
 
Dameria I loved your dice game! Very nice and neat.
I am having to do a dice game and am trying to figure out how to include lists or arrays. When putting in all of the squares and numbers I ran out of room and can no longer see the details window! Not sure how to get that back, but what I wanted to know is this, on your dice game you put everything in it's own folder, how did you do that? Also, do you have to add the folder name when you are calling out a square for instance. This probably all sounds silly to you but I am new to Alice this semester. Thanks.

Dameria 12-04-2010 09:03 PM

[QUOTE=chinchli57;29155]Dameria I loved your dice game! Very nice and neat.
I am having to do a dice game and am trying to figure out how to include lists or arrays. When putting in all of the squares and numbers I ran out of room and can no longer see the details window! Not sure how to get that back, but what I wanted to know is this, on your dice game you put everything in it's own folder, how did you do that? Also, do you have to add the folder name when you are calling out a square for instance. This probably all sounds silly to you but I am new to Alice this semester. Thanks.[/QUOTE]

To add a folder you right click in the object list and press on the "Add Folder" option. You can then drag any options you want into that folder to organize the object panel like I did. By the way I do not have a dice game, I have a tic-tac-toe game. Lists and arrays are not that hard, and they do allow you to do everything you want with a lot less coding, but they can get tricky, so unless you have more than 10 objects that you all want to do the same type of thing, then I suggest you don't use lists. If there are more than 10, than you can, and you use the "For All in Order" a "For All Together" blocks on the bottom to call lists. You then use methods with parameters from there to do the action that you want to with that list.

Shibble 10-18-2011 11:13 AM

Not sure if you will read this because this thread is pretty old, but how did you manage to get the world.playerturn variable to the setSquare method. I have a assingment for school which looks a bit like this, but i can't seen to make a "universal" variable that changes througout the game.

Dameria 10-18-2011 01:24 PM

[QUOTE=Shibble;42526]Not sure if you will read this because this thread is pretty old, but how did you manage to get the world.playerturn variable to the setSquare method. I have a assingment for school which looks a bit like this, but i can't seen to make a "universal" variable that changes througout the game.[/QUOTE]

To make a universal variable you have to create the variable underneath the "World" tab in the object list, the one where every other object branches off of. If you create the variable here, it can be used in any method or object in the program. If you create the variable in any other object, then that variable will only work within that object's methods.

Shibble 10-18-2011 03:27 PM

[QUOTE=Dameria;42532]To make a universal variable you have to create the variable underneath the "World" tab in the object list, the one where every other object branches off of. If you create the variable here, it can be used in any method or object in the program. If you create the variable in any other object, then that variable will only work within that object's methods.[/QUOTE]

With "underneath" the world tab, do you mean, select World and then click variable. Or really create one underneath is so that it's stands on it's own.
(Sorry to bother you, but i'm new to this)

Edit : Looking at you're code, you have a world.playerTurn in your setsqaure method, but i just can't seem to get that to work. Alice won't let me drag the variable into a if/else stament.
[IMG]http://imageshack.us/photo/my-images/843/problemqs.png/[/IMG]
[URL=http://imageshack.us/photo/my-images/843/problemqs.png/][IMG]http://img843.imageshack.us/img843/7530/problemqs.png[/IMG][/URL]

Uploaded with [URL=http://imageshack.us]ImageShack.us[/URL]

Dameria 10-18-2011 05:06 PM

[QUOTE=Shibble;42533]With "underneath" the world tab, do you mean, select World and then click variable. Or really create one underneath is so that it's stands on it's own.
(Sorry to bother you, but i'm new to this)

Edit : Looking at you're code, you have a world.playerTurn in your setsqaure method, but i just can't seem to get that to work. Alice won't let me drag the variable into a if/else statement.
[/QUOTE]

You should always be able to drag a world variable into an if/else statement. Just make sure you create the variable in the "world" tab and not in any other object. You click on "world" then you go to "variables" then you create a new variable, and that is a world variable. You can then drag and drop that variable into any if/else statement and compare whatever you want with it.

Shibble 10-19-2011 04:29 AM

Well i guess Alice is srewing me over then :P

I've been trying that the whole time, but it just won't let me. I'll keep trying ..

Dameria 10-19-2011 08:23 AM

[QUOTE=Shibble;42573]Well i guess Alice is srewing me over then :P

I've been trying that the whole time, but it just won't let me. I'll keep trying ..[/QUOTE]

If you want you could upload your file as a post here and I'll look it over when I get home and try to fix it. Just tell me what method and comment on the if/else statement that you are trying to get the variable into.

Also there are some glitches with using the copy/paste feature in Alice, make sure that the if/else statement is newly dragged into the code and not just a copy from somewhere else, that might do it.

Shibble 10-19-2011 02:05 PM

[QUOTE=Dameria;42575]If you want you could upload your file as a post here and I'll look it over when I get home and try to fix it. Just tell me what method and comment on the if/else statement that you are trying to get the variable into.

Also there are some glitches with using the copy/paste feature in Alice, make sure that the if/else statement is newly dragged into the code and not just a copy from somewhere else, that might do it.[/QUOTE]

Thanks for the offer, but i just managed to get it working :)

I used a fuction that keeps track of the variable. And i was able to combine that function with a variable within the method. Maybe a bit of a detour, but it works :)

Thanks again!


All times are GMT -5. The time now is 09:26 AM.

Copyright ©2019, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.