Jump to content

Joanne

Edu Supporters
  • Posts

    7,886
  • Joined

Everything posted by Joanne

  1. I'm going to take a look at Google Sites and wordpress today and see which one is best.
  2. Would it be accessible by anyone? We'd probably want parents to be able to read it and such. I thought sharepoint was more of a cloud storage type thing?
  3. I can't confirm if they are all using Office 365. I would imagine that they are, however our Office 365 is controlled by County. Will this potentially have an effect? The answer is yes...
  4. Hi guys, my headteacher has asked me about implementing several blogs for a cluster of schools to add to. I was thinking about hosting the blogs on our website, but with the Jotter 2 software, I think we are limited with permissions. I can give a user blog permissions, but they will be able to add to any blog! Which isn't ideal. I've asked WebAnywhere for a solution, but I'm not optimistic about it! There are going to be 6 blogs for Year 1 through 6 and about 19 schools will be writing to them. Each school will have a single log in and have access to all 6 blogs. SO... is there a site that is child friendly and not on the big bad internet that I could create a blog? I guess I could do wordpress and buy a domain name, but that seems a little excessive for what they need. Also I have a feeling it won't really get used... BRAINSTORM TIME!
  5. mine always go on the heel first! I need some new socks. Thanks for reminding me!!
  6. The one that comes with my phone lasts me forever. Dat HTC quality tho
  7. Sausage Party. Glad I didn't watch it at the cinema. How awks is the bit at the end???
  8. Yeah it's because the value of the pound has plummeted. Kinda to be expected really. Sucks!
  9. Nope! Not gonna ruin anything by watching!
  10. chances are I've deleted that e-mail! I wonder if they will send another?
  11. Dayum... I already subscribed. I wonder if I accidentally blocked their e-mail when going through my junk folder...
  12. I have to use IE on the server (2008 R2) because anything newer won't connect due to security certificate nonsense.
  13. Ahhh ok I'll download it when I get home... unlessssss.... yeah can't download it in school because they use a shortened URL. Anyone got the full URL download link?
  14. OMG YES! How do I get it? Steam? How do I stream on my laptop? Twitch? PC gamer n00b.
  15. I'm not massively overweight to be honest, but need to drop a little bit. I'm finding that an incentive is really good for me. Health wasn't good enough hahahah!
  16. turned out they had been sat in the entrance hall for a day and a half! Ooops!
  17. Right well Sunday everything came to a head. I ate some cake and it made me feel so sick I decided I had to make changes! I've been eating well this week and I've been going to a couple of classes and I went back to the gym, which wasn't as bad I was expecting. I have an incentive, which is if I get down to a 30" waist we can go snowboarding for a weekend. Like, proper abroad and stuff. I saw the dietitian yesterday and she told me I had to avoid lactose and honey for the next 2 weeks to see how my symptoms fare. Hopefully all this will go to plan. Husband has actually been supportive and not suggesting dirty takeaways.
  18. So frustrating! I could understand if it were like 100 of the damn things, but only 18!!
  19. I ordered 18 iPad Air 2's like... 2 weeks ago now. They still aren't here. Is anyone else struggling to get hold of Apple kit at the moment? Or have I to give my supplier a kick?
  20. Joanne

    My C issues

    All is working dandy now!! If anyone cares, my final code is this: /** * fifteen.c * * Computer Science 50 * Problem Set 3 * * Implements Game of Fifteen (generalized to d x d). * * Usage: fifteen d * * whereby the board's dimensions are to be d x d, * where d must be in [DIM_MIN,DIM_MAX] * * Note that usleep is obsolete, but it offers more granularity than * sleep and is simpler to use than nanosleep; `man usleep` for more. */ #define _XOPEN_SOURCE 500 #include #include #include #include // constants #define DIM_MIN 3 #define DIM_MAX 9 // board int board[DIM_MAX][DIM_MAX]; // dimensions int d; //global declarations int row, col, val, blankTile, blankTileCol, blankTileRow; // prototypes void clear(void); void greet(void); void init(void); void draw(void); bool move(int tile); bool won(void); int main(int argc, string argv[]) { // ensure proper usage if (argc != 2) { printf("Usage: fifteen d\n"); return 1; } // ensure valid dimensions d = atoi(argv[1]); if (d < DIM_MIN || d > DIM_MAX) { printf("Board must be between %i x %i and %i x %i, inclusive.\n", DIM_MIN, DIM_MIN, DIM_MAX, DIM_MAX); return 2; } //Set blank tile location blankTileRow = (d - 1); blankTileCol = (d - 1); blankTile = board[blankTileRow][blankTileCol]; // open log FILE* file = fopen("log.txt", "w"); if (file == NULL) { return 3; } // greet user with instructions greet(); // initialize the board init(); // accept moves until game is won while (true) { // clear the screen clear(); // draw the current state of the board draw(); // log the current state of the board (for testing) for (int i = 0; i < d; i++) { for (int j = 0; j < d; j++) { fprintf(file, "%i", board[i][j]); if (j < d - 1) { fprintf(file, "|"); } } fprintf(file, "\n"); } fflush(file); // check for win if (won()) { printf("ftw!\n"); break; } // prompt for move printf("Tile to move: "); int tile = GetInt(); // quit if user inputs 0 (for testing) if (tile == 0) { break; } // log move (for testing) fprintf(file, "%i\n", tile); fflush(file); // move if possible, else report illegality if (!move(tile)) { printf("\nIllegal move.\n"); usleep(500000); } // sleep thread for animation's sake usleep(500000); } // close log fclose(file); // success return 0; } /** * Clears screen using ANSI escape sequences. */ void clear(void) { printf("\033[2J"); printf("\033[%d;%dH", 0, 0); } /** * Greets player. */ void greet(void) { clear(); printf("WELCOME TO GAME OF FIFTEEN\n"); usleep(2000000); } /** * Initializes the game's board with tiles numbered 1 through d*d - 1 * (i.e., fills 2D array with values but does not actually print them). */ void init(void) { val = 1; //populate board by row, move along columns for (row = 0; row < d; row++) { for (col = 0; col < d; col++) { //swaps values if board has odd number of tiles (but even d number) if (((d*d)%2) == 0 && ((d * d) - val) == 2) { board[row][col] = 1; } else if (((d*d)%2) == 0 && ((d * d) - val) == 1) { board[row][col] = 2; } else { board[row][col] = (d * d) - val; } val = val + 1; } } board[d-1][d-1] = 0; } /** * Prints the board in its current state. */ void draw(void) { for (row = 0; row < d; row++) { for (col = 0; col < d; col++) { if (board[row][col] == 0) { printf(" _"); } else { printf(" %2d", board[row][col]); } } printf("\n"); } } /** * If tile borders empty space, moves tile and returns true, else * returns false. */ bool move(int tile) { //search for tile for (row = 0; row < d; row++) { //printf("Working on column %d\n", col); for (col = 0; col < d; col++) { //printf("Working on row %d\n", row); if (tile == board[row][col]) { blankTile = 0; //check it is next to 0 if (((blankTileRow == (row - 1)) && (col == blankTileCol)) || (( blankTileRow == (row +1)) && (col == blankTileCol)) || ((row == blankTileRow) && (blankTileCol == (col - 1))) || ((row == blankTileRow) && (blankTileCol == (col + 1)))) { //swap locations of tile and 0 board[blankTileRow][blankTileCol] = tile; board[row][col] = blankTile; blankTileRow = row; blankTileCol = col; return true; } } } } return false; } /** * Returns true if game is won (i.e., board is in winning configuration), * else false. */ bool won(void) { int counter; counter = 1; // Iterate through numbers, checking them for (row = 0; row < d; row++) { for (col = 0; col < d; col++) { if ((counter == (d*d)) && (board[row][col] == 0)) { return true; } if (board[row][col] != counter) { return false; } counter++; } } return true; }
  21. Joanne

    My C issues

    I've been playing with the do while loops. They don't work... /** * fifteen.c * * Computer Science 50 * Problem Set 3 * * Implements Game of Fifteen (generalized to d x d). * * Usage: fifteen d * * whereby the board's dimensions are to be d x d, * where d must be in [DIM_MIN,DIM_MAX] * * Note that usleep is obsolete, but it offers more granularity than * sleep and is simpler to use than nanosleep; `man usleep` for more. */ #define _XOPEN_SOURCE 500 #include #include #include #include // constants #define DIM_MIN 3 #define DIM_MAX 9 // board int board[DIM_MAX][DIM_MAX]; // dimensions int d; //global declarations int row, col, val, blankTile, blankTileCol, blankTileRow; int drawTrue = 0; int initTrue = 0; // prototypes void clear(void); void greet(void); void init(void); void draw(void); bool move(int tile); bool won(void); int main(int argc, string argv[]) { // ensure proper usage if (argc != 2) { printf("Usage: fifteen d\n"); return 1; } // ensure valid dimensions d = atoi(argv[1]); if (d < DIM_MIN || d > DIM_MAX) { printf("Board must be between %i x %i and %i x %i, inclusive.\n", DIM_MIN, DIM_MIN, DIM_MAX, DIM_MAX); return 2; } //Set blank tile location blankTileRow = (d - 1); blankTileCol = (d - 1); blankTile = board[blankTileRow][blankTileCol]; // open log FILE* file = fopen("log.txt", "w"); if (file == NULL) { return 3; } // greet user with instructions greet(); // initialize the board init(); // accept moves until game is won while (true) { // clear the screen clear(); // draw the current state of the board draw(); // log the current state of the board (for testing) for (int i = 0; i < d; i++) { for (int j = 0; j < d; j++) { fprintf(file, "%i", board[i][j]); if (j < d - 1) { fprintf(file, "|"); } } fprintf(file, "\n"); } fflush(file); // check for win if (won()) { printf("ftw!\n"); break; } // prompt for move printf("Tile to move: "); int tile = GetInt(); // quit if user inputs 0 (for testing) if (tile == 0) { break; } // log move (for testing) fprintf(file, "%i\n", tile); fflush(file); // move if possible, else report illegality if (!move(tile)) { printf("\nIllegal move.\n"); usleep(500000); } // sleep thread for animation's sake usleep(500000); } // close log fclose(file); // success return 0; } /** * Clears screen using ANSI escape sequences. */ void clear(void) { printf("\033[2J"); printf("\033[%d;%dH", 0, 0); } /** * Greets player. */ void greet(void) { clear(); printf("WELCOME TO GAME OF FIFTEEN\n"); usleep(2000000); } /** * Initializes the game's board with tiles numbered 1 through d*d - 1 * (i.e., fills 2D array with values but does not actually print them). */ void init(void) { val = 1; //populate board by row, move along columns for (row = 0; row < d; row++) { for (col = 0; col < d; col++) { board[row][col] = (d * d) - val; val = val + 1; } } board[d-1][d-1] = 0; //switch 1 and 2 for odd number of tiles do { if ((d %2 == 0) && board[row][col] == 2) { board[row][col] = 1; } else if ((d %2 == 0) && board[row][col] == 1) { board[row][col] = 2; } initTrue = 1; } while (initTrue == 0); } /** * Prints the board in its current state. */ void draw(void) { val = 1; //populate board by row, move along columns for (row = 0; row < d; row++) { for (col = 0; col < d; col++) { do { if ((d %2 == 0) && board[row][col] == 2) { board[row][col] = 1; } else if ((d %2 == 0) && board[row][col] == 1) { board[row][col] = 2; } drawTrue = 1; } while (drawTrue == 0); if (board[row][col] == 0) { printf(" _"); } else { printf(" %2d", board[row][col]); } } printf("\n"); } } /** * If tile borders empty space, moves tile and returns true, else * returns false. */ bool move(int tile) { //search for tile for (row = 0; row < d; row++) { //printf("Working on column %d\n", col); for (col = 0; col < d; col++) { //printf("Working on row %d\n", row); if (tile == board[row][col]) { blankTile = 0; //check it is next to 0 if (((blankTileRow == (row - 1)) && (col == blankTileCol)) || (( blankTileRow == (row +1)) && (col == blankTileCol)) || ((row == blankTileRow) && (blankTileCol == (col - 1))) || ((row == blankTileRow) && (blankTileCol == (col + 1)))) { //swap locations of tile and 0 board[blankTileRow][blankTileCol] = tile; board[row][col] = blankTile; blankTileRow = row; blankTileCol = col; return true; } } } } return false; } /** * Returns true if game is won (i.e., board is in winning configuration), * else false. */ bool won(void) { int counter; counter = 1; // Iterate through numbers, checking them for (row = 0; row < d; row++) { for (col = 0; col < d; col++) { if ((counter == (d*d)) && (board[row][col] == 0)) { return true; } if (board[row][col] != counter) { return false; } counter++; } } return true; } Bear in mind I'll get to the formatting bit when I'm finished messing
  22. Joanne

    My C issues

    So things are working now... (thanks @jwinters !) but this swap function, continuously swaps the values on a 4x4 grid... so I think I need to put a do while loop in there, so it only does the swap once at the beginning. Would you agree with that? Or is there a better solution?
  23. Joanne

    My C issues

    Right I'm trying to figure out how to stop the counter at (d*d) - 1.... so currently it checks the first tile is 1, second is 2.. if it isn't it returns false. Then if the last square is 0 returns true.... This is the winning combination: /** * Returns true if game is won (i.e., board is in winning configuration), * else false. */ bool won(void) { int counter; counter = 1; //itterate through numbers, checking them for (row = 0; row < d; row++) { for (col = 0; col < d; col++) { if (board[row][col] != counter) { return false; counter++; } if ((counter == (d*d)) && (board[row][col] == 0)) { return true; } } } return true; }
  24. Joanne

    My C issues

    yeah the swap works. Just the win bit to sort out and I'm golden. I can't thank you guys enough for all of your help. @elsiegee40 @witch I'm trying to send big rep to @Steve21 for helping me, but it won't let me! Please could you guys do it for me
  25. Joanne

    My C issues

    deleted the two lines at the beginning and OMG IT WORKS!
×
×
  • Create New...