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

Show off your games, demos and other (playable) creations.
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

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

Post by Nixola »

DAMN. Good job on that.
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
User avatar
unek
Citizen
Posts: 86
Joined: Fri Oct 12, 2012 8:43 pm
Location: Poland
Contact:

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

Post by unek »

micha wrote:Boom!
numberwang.png
Nicely done. I like the sweeping animation.
Damn, congrats.
DRAW DRAW - online painting app CLICK NUMBERS - cool game with numbers THEME LOVEFRAMES - a collection of my themes HOST FOR FREE - free hosting for online LOVE games STALK PEOPLE - a map of LOVE users
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

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

Post by Robin »

Nice.

162!

Image
Help us help you: attach a .love.
User avatar
VideahGams
Prole
Posts: 25
Joined: Wed Dec 31, 2014 5:56 pm
Location: Scotland
Contact:

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

Post 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
User avatar
Guard13007
Party member
Posts: 132
Joined: Sat Oct 25, 2014 3:42 am
Location: Internet, USA
Contact:

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

Post 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?
User avatar
VideahGams
Prole
Posts: 25
Joined: Wed Dec 31, 2014 5:56 pm
Location: Scotland
Contact:

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

Post 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.
User avatar
raingloom
Prole
Posts: 36
Joined: Wed Apr 22, 2015 12:35 am
Location: Always elsewhere

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

Post 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.
Guiilleh
Prole
Posts: 1
Joined: Wed Nov 18, 2015 7:48 pm

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

Post by Guiilleh »

This game is really addictive lol
Image
User avatar
HugoBDesigner
Party member
Posts: 403
Joined: Mon Feb 24, 2014 6:54 pm
Location: Above the Pocket Dimension
Contact:

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

Post 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: )
@HugoBDesigner - Twitter
HugoBDesigner - Blog
User avatar
Beelz
Party member
Posts: 234
Joined: Thu Sep 24, 2015 1:05 pm
Location: New York, USA
Contact:

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

Post by Beelz »

Nice game, very addicting.
Attachments
numberfucker204.png
numberfucker204.png (11.86 KiB) Viewed 3869 times
Last edited by Beelz on Mon Nov 23, 2015 3:43 am, edited 1 time in total.

Code: Select all

if self:hasBeer() then self:drink()
else self:getBeer() end
GitHub -- Website
Post Reply

Who is online

Users browsing this forum: Roland Chastain and 189 guests