Jump to content




[Teletext Characters] Infinity Loop CC -- Now With 100% More Menus!


16 replies to this topic

#1 KingofGamesYami

  • Members
  • 3,002 posts
  • LocationUnited States of America

Posted 11 August 2016 - 12:26 AM

This is my port of infinity loop to ComputerCraft. It's a simple puzzle game with one objective - tie up all the ends, creating one or more infinite loops.
The program features the game itself as well as an editor. To aquire it, simply run:
pastebin get SFuBaAKT infloop
Editor:
After selecting the file to edit, use 'q' to save & quit, or 'r' to randomize the direction of the tiles. Right & Left click cycle through tiles.
I encourage you to send a PR with your files to my github repository, which can be downloaded by anyone.
New! Use 'c' to choose foreground and background colors! (foreground prompts first)
Main Game:
Use right or left click to rotate a tile
Credits:
nitrogenfingers for his excellent micropaint program
CoderPuppy for beta-testing
∞ Infinity Games for creating the original game (I've played more than 1000 levels!)
ElvishJerricco for his json API
Versions:
1.1 - Added a menu, including an option to download levels from github
1.2 - Added custom color support
1.25 - Fixed color changing in the editor
1.5 - Added solve.lua support (download, solve, and generate random)
This program uses my minimenu and menu to provide a UI.

Edited by KingofGamesYami, 18 August 2016 - 07:37 PM.


#2 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 11 August 2016 - 02:49 AM

Plays well enough, but do you intend to extend it? It could use a bit more in the way of "interface". Certainly a random level generator would make it a lot more "playable".

Because I'm not very creative I copied a couple of levels out of the android version's screenshots.

Spoiler


#3 nitrogenfingers

    Lua Professor

  • Members
  • 551 posts
  • LocationAustralia

Posted 11 August 2016 - 03:41 AM

This is really cool, but it definitely needs more content. A few interface niceties wouldn't go astray either- maybe a level folder and an in-game menu rather than providing a path by command line.

Also could you change line 297 to be draw( shell.resolve(tArgs[1])) or similar?

#4 KingofGamesYami

  • Members
  • 3,002 posts
  • LocationUnited States of America

Posted 11 August 2016 - 01:37 PM

I do indeed intend to work on this quite a bit more - this is mostly what I wrote while on vacation, with no internet and no testing environment (chromebooks suck). I bugfixed and added the tile graphics yesterday.

#5 KingofGamesYami

  • Members
  • 3,002 posts
  • LocationUnited States of America

Posted 11 August 2016 - 09:24 PM

Update - I've now added a menu, along with an option to download levels from github. The levels are stored in their own directory.

View PostBomb Bloke, on 11 August 2016 - 02:49 AM, said:

Plays well enough, but do you intend to extend it? It could use a bit more in the way of "interface". Certainly a random level generator would make it a lot more "playable".
Because I'm not very creative I copied a couple of levels out of the android version's screenshots.
-snip-

I'll look into a random level generator, and I've added the levels you created to the github repository - PM me if you would like them removed.

#6 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 13 August 2016 - 12:34 PM

As I said, they're not my levels. ;)

Another suggestion you may or may not be interested in - random colour schemes. Say brown on red, or purple on blue, grey on lightGrey, and so on; just pick a different combination with each puzzle. It's a minor thing, but I reckon it'd do a lot for the "feel" of the game.

#7 KingofGamesYami

  • Members
  • 3,002 posts
  • LocationUnited States of America

Posted 13 August 2016 - 03:27 PM

View PostBomb Bloke, on 13 August 2016 - 12:34 PM, said:

As I said, they're not my levels. ;)
Another suggestion you may or may not be interested in - random colour schemes. Say brown on red, or purple on blue, grey on lightGrey, and so on; just pick a different combination with each puzzle. It's a minor thing, but I reckon it'd do a lot for the "feel" of the game.

I know they aren't "yours", but I'm too lazy to figure out which levels they are - it's easier to just stick any levels submitted by a given person in their folder.

I've thought about random color schemes, but I'm unsure if I should do a random one every time you play a level, or if I should tie a color scheme to a level permanently. The former would certainly be easier, but the latter is closer to the behavior of the actual game.

#8 supernicejohn

  • Members
  • 98 posts
  • LocationSweden

Posted 13 August 2016 - 09:02 PM

Ok, I don't understand github, but I made two very difficult levels, both tested of course.
1:
00000000000000000
00000000000000000
008b529184499e9e4
00998a55caba86788
0097976c8b88c6769
00babfceebac9f9f7
009857fbc669893f1
006caa868572eb9e2
00000000000000000
2:
858dae62889645597
5ffc4a698e7cb5147
56db9beaa6a2dc848
87b67deaabb8b6bbb
398bb4758dd7d2985
7716d52c86f4dbd51
27521e7a1bc3b9bb7
ce6e76efe85618829
546d86263315aaae8
Nice game, and I agree that colors would be a good idea!

#9 H4X0RZ

  • Members
  • 1,315 posts
  • LocationGermany

Posted 13 August 2016 - 10:39 PM

View PostKingofGamesYami, on 13 August 2016 - 03:27 PM, said:

View PostBomb Bloke, on 13 August 2016 - 12:34 PM, said:

As I said, they're not my levels. ;)/>
Another suggestion you may or may not be interested in - random colour schemes. Say brown on red, or purple on blue, grey on lightGrey, and so on; just pick a different combination with each puzzle. It's a minor thing, but I reckon it'd do a lot for the "feel" of the game.

I know they aren't "yours", but I'm too lazy to figure out which levels they are - it's easier to just stick any levels submitted by a given person in their folder.

I've thought about random color schemes, but I'm unsure if I should do a random one every time you play a level, or if I should tie a color scheme to a level permanently. The former would certainly be easier, but the latter is closer to the behavior of the actual game.

Maybe just add the scheme to the level format (at the top/bottom) as a separate line?

#10 KingofGamesYami

  • Members
  • 3,002 posts
  • LocationUnited States of America

Posted 14 August 2016 - 12:35 AM

View Postsupernicejohn, on 13 August 2016 - 09:02 PM, said:

Ok, I don't understand github, but I made two very difficult levels, both tested of course.
-snip-
Nice game, and I agree that colors would be a good idea!

I've added them to github myself, although it's really quite easy. Just fork the repo and make changes, then send a Pull Request with those changes to my repo.

Thanks, I'll definitely be looking into colors some more.

View PostH4X0RZ, on 13 August 2016 - 10:39 PM, said:

-snip-
Maybe just add the scheme to the level format (at the top/bottom) as a separate line?

Seems like a good way to handle things, I'll do it. Probably add it to the bottom, so I don't have to update the current level files.

#11 KingofGamesYami

  • Members
  • 3,002 posts
  • LocationUnited States of America

Posted 14 August 2016 - 02:04 AM

1.2 has been released! Color is now supported, you can press 'c' in the level editor to change the colors.

Known Bugs
-Colors do not update after selecting them in the editor (this will be fixed in 1.25)


1.25 released! Colors now change properly in the editor!

Edited by KingofGamesYami, 14 August 2016 - 12:58 PM.


#12 CoderPuppy

  • Members
  • 121 posts

Posted 14 August 2016 - 09:04 PM

I wrote a level solver and generator

source: https://github.com/C...ppy/ilcc-solver

here's it solving supernicejohn's second level:
Posted Image

and generating a 10x10 level:
Posted Image

#13 supernicejohn

  • Members
  • 98 posts
  • LocationSweden

Posted 14 August 2016 - 09:20 PM

How even.

View PostCoderPuppy, on 14 August 2016 - 09:04 PM, said:

I wrote a level solver and generator

source: https://github.com/C...ppy/ilcc-solver

That's. Yeah.

#14 CoderPuppy

  • Members
  • 121 posts

Posted 14 August 2016 - 09:42 PM

View Postsupernicejohn, on 14 August 2016 - 09:20 PM, said:

How even.

It starts with knowing that there can't be connections on the edge
Then it repeatedly for each active tile (propagates from the sides) finds all the possible variants (a.k.a. rotations) given which connections must exist and which must not and figures out which connections are in all the variants and which are in none and applies that data (affecting neighboring tiles and making them active)

That works for some levels but not for supernicejohn/1, supernicejohn/2 and BombBloke/1 in which there are ambiguous areas, there it uses the first possible variant for one of the unknown tiles and continues.
It might be possible to create a level where doing that won't work (where choosing one of the possibilities will make it impossible to complete) but I wasn't able to create one so that's not fully implemented yet.

#15 supernicejohn

  • Members
  • 98 posts
  • LocationSweden

Posted 14 August 2016 - 09:51 PM

Huh. I thought that this type of puzzle was difficult enough that (other than bruteforcing) only the outer edges could be solved.
I'll dig through your code and see if I can understand how it does the second part.
Also the third part, I thought that it really wouldn't work to do that. I've sometimes gotten two unfinished ones one opposite sides of the puzzle, but maybe that can be completely solved with the iterative approach. I don't know. But a Good Job to you!

Now to prove that last part mathematically. =P

#16 KingofGamesYami

  • Members
  • 3,002 posts
  • LocationUnited States of America

Posted 18 August 2016 - 02:25 PM

I have created a build which implements CoderPuppy's solve.lua, but I'm waiting on this issue to be resolved before I release it.

#17 KingofGamesYami

  • Members
  • 3,002 posts
  • LocationUnited States of America

Posted 18 August 2016 - 07:37 PM

Version 1.5 Released! Added support for CoderPuppy's solve.lua





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users