Page 2 of 3

Re: NUMBERF/CKER (formerly Numberwang) - math game (not 2048

Posted: Fri Jul 17, 2015 9:45 am
by Nixola
DAMN. Good job on that.

Re: NUMBERF/CKER (formerly Numberwang) - math game (not 2048

Posted: Fri Jul 17, 2015 10:24 am
by unek
micha wrote:Boom!
numberwang.png
Nicely done. I like the sweeping animation.
Damn, congrats.

Re: NUMBERF/CKER (formerly Numberwang) - math game (not 2048

Posted: Fri Jul 17, 2015 12:57 pm
by Robin
Nice.

162!

Image

Re: NUMBERF/CKER (formerly Numberwang) - math game (not 2048

Posted: Fri Jul 17, 2015 9:45 pm
by VideahGams
For funsies, I'm writing a crappy little bot for this.
I need to rethink some of the logic for the bot, but it can get around 60-80 points.

Image

Re: NUMBERF/CKER (formerly Numberwang) - math game (not 2048

Posted: Sun Jul 19, 2015 4:23 am
by Guard13007
VideahGams wrote:For funsies, I'm writing a crappy little bot for this.
I need to rethink some of the logic for the bot, but it can get around 60-80 points.
That sounds pretty interesting, could you elaborate how it works and/or show some code for it?

Re: NUMBERF/CKER (formerly Numberwang) - math game (not 2048

Posted: Mon Jul 20, 2015 7:23 am
by VideahGams
Guard13007 wrote:That sounds pretty interesting, could you elaborate how it works and/or show some code for it?
Sure!

To start off with, I make most of the variables in main.lua global so the bot can read them.

Code: Select all

board = {}
size_w = 3
size_h = 3

n = 0
min, max = 1, 9

gameover = false

biggest_x, biggest_y = 0, 0

bigfont = love.graphics.newFont("swag/Junction-bold.otf", 25)
smallfont = love.graphics.newFont("swag/Junction-bold.otf", 32)

bg = {0, 0, 0}--{255, 60, 60}--

anim_from_x, anim_from_y = 0, 0
anim_to_x, anim_to_y = 0, 0
anim_from, anim_to = 0, 0
anim_dt = 0
anim_time = 0.35
anim_after = nil
I then have the bot in a script called NFBot.lua in NumberFuckers directory and require it at the bottom of love.load() like so:

Code: Select all

function love.load()
  io.stdout:setvbuf("no")

  generate()
  require 'NFBot'
end
The structure of NFBot.lua is like this:

Code: Select all

local originalDraw = love.draw -- Get NumberFuckers draw function.
local originalUpdate = love.update -- Get NumberFuckers update function.

function love.draw()
	originalDraw()

	-- We can draw our own stuff here.

end

function love.update(dt)
	originalUpdate(dt)

	-- We can do our own logic here.

end
We can click tiles using love.mousepressed().

So we cycle through the tiles and see if the tile is dividable by the number.
If it is dividable, place the number in an adjacent tile.
If there is no possible tiles, then place it anywhere.
I know, not very smart, but i'm in the process of re-writing the logic, so I don't have much code to show for it but here's a webm of the dumb version of the bot in action. http://webm.host/76cae/vid.webm

When it's finished I'll probably stick it up on GitHub.

Re: NUMBERF/CKER (formerly Numberwang) - math game (not 2048

Posted: Thu Jul 23, 2015 5:44 pm
by raingloom
I started to lose concentration near the end, but I think I've got the gist of its logic. Danger of addiction.
Image
For the bot: why not use some fancy prime factorization to sort out which numbers are the most divisible?
You could sort possible outcomes by something like the global number of divisors, but I'm sure there is a better way to do it.

Re: NUMBERF/CKER (formerly Numberwang) - math game (not 2048

Posted: Wed Nov 18, 2015 7:54 pm
by Guiilleh
This game is really addictive lol
Image

Re: NUMBERF/CKER (formerly Numberwang) - math game (not 2048

Posted: Wed Nov 18, 2015 10:44 pm
by HugoBDesigner
Dang, got 220 but didn't take a pic...

Oh well, this game is great and really addictive. Too bad I suck at mental calculation, so I cheated quite a lot (had a calculator on another window :rofl: )

Re: NUMBERF/CKER (formerly Numberwang) - math game (not 2048

Posted: Thu Nov 19, 2015 3:56 am
by Beelz
Nice game, very addicting.